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.
More Related Contents:
- Convert JSON to array in Javascript
- How to convert HTML to JSON using PHP?
- json_encode not preserving order
- send json object from javascript to php
- Encrypt string in PHP and decrypt in Node.js
- jQuery AJAX Call to PHP Script with JSON Return
- Passing JSON data from php to html-data attribute and then to Javascript
- IE10/11 Ajax XHR error – SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3
- Best way to store JSON in an HTML attribute?
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- How to return an array from an AJAX call?
- How to hide css and js version details from weppalyzer in PHP
- How to list array names in json [closed]
- Parsing string as JSON with single quotes?
- “Mixed content blocked” when running an HTTP AJAX operation in an HTTPS page
- Send JSON data from Javascript to PHP?
- Double quotes within php script echo
- How to refresh page on back button click?
- How to stringify inherited objects to JSON?
- sending file and json in POST multipart/form-data request with axios
- How to prevent page from reloading after form submit – JQuery
- how to change the headers for angularjs $http.jsonp
- How to solve Uncaught RangeError when download large size json
- Include CSS,javascript file in Yii Framework
- How do I refresh a DIV content?
- JSON Parse File Path
- How to restore original object/type from JSON?
- Cross-Origin resource sharing and file://
- sending data as JSON object from Python to Javascript with Jinja [duplicate]
- Process a continuous stream of JSON