Quantcast
Channel: PHP XML disable feed if offline - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Pekka for PHP XML disable feed if offline

You can use file_get_contents() and define the timeout using a stream context as explained here:Does file_get_contents() have a timeout setting?Modified code from the answer there:...

View Article



PHP XML disable feed if offline

<?php define(feed,'http://www.example.com/feed/'); $xml_feed = file_get_contents(feed); $xml_parser = xml_parser_create(); xml_parse_into_struct($xml_parser,$xml_feed,$xml_keys,$xml_index);...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images