code_junkie

The number of ways of reading an xml file from another server in PHP?

Nov 11th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. $url = urldecode( $object_list_url );
  2. $xmlstr = file_get_contents ( $url );
  3. $obj = new SimpleXMLElement ( $xmlstr, LIBXML_NOCDATA );
  4.  
  5. $c = curl_init($url);
  6. curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
  7. $xmlstr = curl_exec($c);
  8.  
  9. var_dump(ini_get('allow_url_fopen'));
  10.  
  11. <?php
  12. phpinfo();
  13. ?>
Add Comment
Please, Sign In to add comment