Re: Help! Having trouble getting one XML field from this feed reliably
| From: | Adam Richardson | Date: | Thu, 09 Feb 2012 15:55:45 +0000 |
| Subject: | Re: Help! Having trouble getting one XML field from this feed reliably | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316568@lists.php.net to get a copy of this message | ||
On Thu, Feb 9, 2012 at 9:10 AM, Yared Hufkens <y423d@yahoo.de> wrote:
> I wonder why you use cURL as SimpleXML itself can load URLs:
>
> $vastdata = new
>
> SimpleXMLElement('http://afe.specificclick.net/?l=32259&t=x&rnd=123456
> ',0,true);
>
> See http://de.php.net/manual/en/simplexmlelement.construct.php
It is pretty convenient that SimpleXMLElement allows you to grab URL's, but
curl allows me to manually set a timeout limit (along with many other
things, although they're not necessarily needed in Rob's example), so I
tend to use curl in this type situation, too.
Adam
--
Nephtali: A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com