![]() |
How To convert the Php array to Javascript array - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How To convert the Php array to Javascript array (/showthread.php?tid=64530) |
How To convert the Php array to Javascript array - Chandini - 03-01-2016 This is My php Array PHP Code: Array Code: <script type="text/javascript"> RE: How To convert the Php array to Javascript array - Mangetsu - 03-01-2016 PHP Code: $input=array( Send it to view or whatever and echo as JS variable. RE: How To convert the Php array to Javascript array - skunkbad - 03-01-2016 If you're actually printing the json encoded string in an attribute, and then expect JS to get that string and use it as an array or object, you'll need to use JSON.parse() in your JS. |