The parser API Yandex-the weather does not give image-v3 (xml, php). Why?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
28 views
The code that displays all -

<?php$xml = 'http://export.yandex.ru/weather-ng/forecasts/32150.xml';  //адрес$rss = simplexml_load_file($xml); //пыдыщforeach ($rss->fact as $fact) { $temp = $fact->temperature; //print the temperature $type = $fact->weather_type; //print type $pic = $fact->image-v3; //print Piccard echo $temp; echo '
'; echo $type; echo '
'; echo $pic; } ?>


Only reason is not displayed image-v3, and it is very necessary. Why?
by | 28 views

2 Answers

0 like 0 dislike
Is $fact->image-v3 use $fact->{'image-v3'}
by
0 like 0 dislike
If you write something, at least put the error output.
PHP tells you that there is no image element, and that the constant v3 is unknown to him. But you can't hear him. And it would clearly tell you in what direction to dig. And would come with specific question "how to handle the image element is v3?", instead.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
asked Apr 6, 2019 by nepster-web
0 like 0 dislike
3 answers
asked Apr 1, 2019 by nepster-web
0 like 0 dislike
2 answers
110,608 questions
257,187 answers
0 comments
40,251 users