Sunday, 15 April 2012

php - How do I parse a specific json data response? -


I was pushing my hair for the past few days.

I just want to parse a piece of data from the string response using the received method.

My PHP code I'm working with:

    

The results I get:

  {"data1": "value1", "data2": "value2", "data3": " I want to display "value3" only for my output, but I want to add the full string to "value3", "data4": "value4", "data5": "value5"}   

The response is getting.

If you want the data to be the key address (data 3 part) you can json_response_data json_decode :

  if ($ response_status == "200") {$ decoded = json_decode ($ json_response_data); Echo $ decode ['data3']; }    

No comments:

Post a Comment