Re: Help translating PHP5 code to PHP4.
| From: | sexyprout | Date: | Mon, 07 Mar 2011 16:30:24 +0000 |
| Subject: | Re: Help translating PHP5 code to PHP4. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311732@lists.php.net to get a copy of this message | ||
Just take another web host.
2011/3/7 Marc Guay <marc.guay@gmail.com>
> Hi folks,
>
> I've stumbled into a project involving a server running PHP4 without
> cURL. The script fetches data from an XML webservice and deals with
> it. Is http://ca2.php.net/xml_parser_create the place to
> start? Any
> tips (besides updating PHP)?
>
> Here's an example of the PHP5 code:
>
> $url =
> "http://www.domain.com/webservice.php?var=foo";
> $ch = curl_init($url);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
> $val = curl_exec($ch);
> curl_close($ch);
> libxml_use_internal_errors(true);
> $xml = simplexml_load_string($val);
> $errors = libxml_get_errors();
>
> if (!($errors)){
> $myvariable = $xml->attributes()->value;
> }
> else{
> // deal with errors
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
sexyprout