How to change data php to javascript json [closed]

It seems like you want to encode your PHP array to JSON. Use json_encode() for that.

json_encode($array);

Returns a string containing the JSON representation of value.

Leave a Comment