how do i convert a json object to a string
i want to insert a json object to a mysql DB
how do i convert a json object to a string
i want to insert a json object to a mysql DB
You might be interested in json_encode().
On the other hand if you already got something json encoded then it already is a string and you can simply store it as-is in the database.
JSON itself is a string. People use json_encode() and json_decode() to convert objects/arrays of PHP to string and back to objects/arrays.
$array = json_decode($json,true); $string = implode(",",$array);
Now you can save this string in db as text.