Answer the question
In order to leave comments, you need to log in
What has changed: simplexml parsing in foreach in php 5.6?
Updated PHP to 5.6 some scripts stopped working. If this code worked before:
foreach ($xml->response->results->grouping->group as $group)
{
$results[] = Array('domain' => trim($group->doc->domain), 'url' => trim($group->doc->url),'title' => $group->doc->title);
if ($results[$i]['domain'] == $our_domain) { $found = true; $found_index = $i; }
$i++;
}
Answer the question
In order to leave comments, you need to log in
I don't know what was the problem.
Configured via xpatch
$xml = @simplexml_load_string($fp,'SimpleXMLElement', LIBXML_NOCDATA) or die("Error: Cannot create object");
foreach ($xml->xpath('//domain') as $title) {
echo "". $title. "";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question