Passing a PHP array to JavaScript
Moderator: General Moderators
-
berkayxx95
- Forum Newbie
- Posts: 1
- Joined: Fri Jan 26, 2018 5:23 pm
Passing a PHP array to JavaScript
Hello, I am trying to pass a JavaScript array to PHP. Is there a basic way to do it without going into other languages?
Re: Passing a PHP array to JavaScript
Send it in as an AJAX request and then use json_decode
Re: Passing a PHP array to JavaScript
o convert your PHP array into JSON, you can use the json_encode function, which will return the JSON representation of the value that you have passed it