Answer the question
In order to leave comments, you need to log in
How to exchange data in json format with another site?
Hello!
You need to write controllers to receive requested data from another site. The data must come in json format. In which direction to dig? Do I understand correctly that it is necessary to use cURL for this, or is it possible without it? Please tell me who knows where to read how this is generally organized in php? I can't find much on the Internet.
Answer the question
In order to leave comments, you need to log in
The big problem with many things is terminology.
you can simply start like this
$arr = json_decode(file_get_contents(' site.com/json.txt '), true); or into an object without true
we get an array and process the data....
the same with CURL is more complicated, but we already process response statuses, sizes, set timeouts, etc...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question