I try to adjust interaction through API with the application. The problem arises due to lack of knowledge, I do not understand what to do next.

Here is the test page http://7815671.ru/test.php The algorithm is as follows: upload a photo, select a filter for processing and press the process button, then it gives

{ "status":"ok","result":"http:\/\/api3-eu.neuralprisma.com\/process_direct\/12d7a9c4-f881-4c84-a259-64d495d4ee2c_us\/s_8","photo_id":"12d7a9c4-f881-4c84-a259-64d495d4ee2c_us"} 

If in the "http: remove all slashes" \ "then it turns out that this is the processed photo filter.

I do not understand what to do next how to process and display the result.

There is an array .JSON

http://pastebin.com/Gxdnc2Pp

I understand that the answer from the server should be parsed as? Already 3 day I have been struggling with the head around.

  • php.net/manual/ru/function.json-decode.php use on health - Alexey Shimansky
  • Thank!! The fact of the matter is that I just study everything in my head porridge. - ZT-MOVIES
  • Tell me where to start? - ZT-MOVIES
  • What does it mean to start? Are you at all or specifically about this question? If about a question, then take a json string, for example, it is lame in the $json variable, write $array = json_decode($json, true); ...... further in the $array will be an associative array with which you work further - Alexey Shimansky
  • Alex, thanks now clear. - ZT-MOVIES

1 answer 1

To work with json in php just use the json_decode function, which decodes the JSON string.

For example, you have a JSON string in the $json variable.

You write:

 $array = json_decode($json, true); 

As a result, you will get an associative array that will lie in the $array variable, with which you are working further at your discretion.