How to convert object data into json string in PHP? -
I am getting results in the object and I have to change it in Jason and I do not understand that doing this I need help
<< p> << p> << p> << p>] = & gt; Chang Sindelar) [1] = & gt; Study Class Object ([user_id] = & gt; 84 [username]] = Sylvester Hillebrand))
and I convert to json
string Want to I want some results in this way:
{"85": "Chang Sindelar", "84": "Ezekiel Watersson", "83": "Sylvester Hillebrand"}
No Idea
Thank you.
Using this function, your object will return to the array of properties of that object.
array get_object_vars (object $ object) returns get_object_vars ($ your_object_variable_here)
Comments
Post a Comment