We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have this result from server:
<?xml version="1.0" encoding="UTF-8"?> <yandexsearch version="1.0"><response date="20200221T142812"><error code="15">Для заданного поискового запроса отсутствуют результаты поиска.</error></response></yandexsearch>
$response->data return this array:
array(2) { ["@attributes"]=> array(1) { ["version"]=> string(3) "1.0" } ["response"]=> array(2) { ["@attributes"]=> array(1) { ["date"]=> string(15) "20200221T150244" } ["error"]=> string(119) "Для заданного поискового запроса отсутствуют результаты поиска." } }
code="15" is not in data array. I can get this code manually, but I think it would be better if it is in @attributes in data.
$xml = simplexml_load_string($response->content, 'SimpleXMLElement', LIBXML_NOCDATA); $code = (string) $xml->response->error->attributes()->code;
The text was updated successfully, but these errors were encountered:
Could you provide some code that could be used to reproduce it?
Sorry, something went wrong.
$client = new \yii\httpclient\Client; $response = new \yii\httpclient\Response(['client' => $client]); $response->setContent('<?xml version="1.0" encoding="UTF-8"?> <yandexsearch version="1.0"><response date="20200221T142812"><error code="15">Для заданного поискового запроса отсутствуют результаты поиска.</error></response></yandexsearch>'); var_dump($response->data);
php 7.3.2 Windows
No branches or pull requests
I have this result from server:
$response->data return this array:
code="15" is not in data array. I can get this code manually, but I think it would be better if it is in @attributes in data.
The text was updated successfully, but these errors were encountered: