I don't understand PHP for simple JSON string output. could you tell me the json string output by the following code?
Class pic_data {public $ data; public $ status; public $ statusText; public function _ construct () {$ this-> data-> urls = array ();}} $ d = new pic_data (); $ d-> data-> photoId = 'photoid123'; $ d-> data-> urls [0] = 'url123 '; $ d-> status = 1; $ d-> statusText = 'upload successful! '; $ Msg = json_encode ($ d); echo $ msg;
Reply to discussion (solution)
{"Data": {"urls": ["url123"], "photoId": "photoId123"}, "status": 1, "statusText ": "\ u4e0a \ u4f20 \ u6210 \ u529f! "}
Information related to objects, including object IDs
{"Data": {"urls": ["url123"], "photoId": "photoId123"}, "status": 1, "statusText ": "\ u4e0a \ u4f20 \ u6210 \ u529f! "}
You only need to know the specific meaning
Json format, json parsing, json format online verification tool www.kjson.com