I can not understand how to parse a string:
useriata({"iata":"MOW","name":"Москва"}) This is not an array, and not json.
I can not understand how to parse a string:
useriata({"iata":"MOW","name":"Москва"}) This is not an array, and not json.
This data transfer format is called JSONP .
And parsing it is very simple: you bite the wrapping function and parse JSON using standard tools.
For example:
$jsonp_data = 'useriata({"iata":"MOW","name":"Москва"})'; $json = preg_replace('/^[^\(]+\((.*)\)$/', '$1', $jsonp_data); var_dump(json_decode($json)); Most likely - this is JSONP. In this case, you can simply throw out ^useriata(\{ and \)$ (not strong in the regulars syntax, but the point is to remove the beginning and end of the line)
Source: https://ru.stackoverflow.com/questions/576200/
All Articles
$data = 'useriata({"iata":"MOW","name":"Москва"})'? - PinkTuxuseriata({"iata":"MOW","name":"Москва"})stringuseriata({"iata":"MOW","name":"Москва"})to me - JamesJGoodwinuseriata(...)and parse as usual JSON. - PinkTux