Php has an inbuilt JSON Serialising function.
json_encode
Please use that if you can and don’t suffer Not Invented Here syndrome.
More Related Contents:
- PHP json_encode encoding numbers as strings
- The holy grail of cleaning input and output in php?
- Send JSON data from Javascript to PHP?
- JavaScript: How do I create JSONP?
- How to retrieve Request Payload
- How to pass an array using PHP & Ajax to Javascript?
- json parse error with double quotes
- Writing JSON object to .json file on server
- Is the following code valid? [closed]
- How to send email out by php or javascript? [closed]
- Pass a PHP string to a JavaScript variable (and escape newlines) [duplicate]
- Convert php array to Javascript
- Reference: Why are my “special” Unicode characters encoded weird using json_encode?
- Pass Javascript Array -> PHP
- Generate json string from multidimensional array data [duplicate]
- How can I use a JavaScript variable as a PHP variable? [duplicate]
- JavaScript equivalent of PHP’s in_array()
- How do I run PHP code when a user clicks on a link?
- Sending JSON to PHP using ajax
- Resize iframe height according to content height in it
- Google GCM server returns Unauthorized Error 401
- passing php variable from controller to javascript function in the head of a view
- How to solve JSON_ERROR_UTF8 error in php json_decode?
- Why are floating point numbers printed so differently?
- How to preview an image before and after upload?
- How to access JSON decoded array in PHP
- How to loop through PHP object with dynamic keys [duplicate]
- Storing arrays in the database
- Is there a function similar to setTimeout() (JavaScript) for PHP?
- Detect Ajax calling URL