Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
When I execute my script to read a xml feed, the following error is produced:Code: Select all
Warning: file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in test.php on line 12
Warning: file(http://feeds.<domain>.co.uk/?bb14ed26-fdd2-491a-bef5-858ddbe5b58f): failed to open stream: Success in test.php on line 12
Warning: Invalid argument supplied for foreach() in test.php on line 15However, if I refresh the page to re-execute the code, it will then work. Every time I refresh it alternates between error and working. The code is as follows:
Code: Select all
<?php
$lines = file('http://feeds.<domain>.co.uk/?bb14ed26-fdd2-491a-bef5-858ddbe5b58f');
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]