Why does xml_parse_into_struct fail on this page?

I'm using php 5.0.3, I cannot upgrade.

<?php
  $url='http://www.inman.com/rss/IMRSS2_Residential.xml';
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  $content = curl_exec ($ch); # This returns HTML
  curl_close ($ch);
 
  $p = xml_parser_create();
  $vals=array();
  $index=array();
  //xml_parse_into_struct($p, $c, $vals, $index);
  $x = xml_parse_into_struct($p, $content, $vals, $index);
  xml_parser_free($p);
?>
LVL 2
tansofunAsked:
Who is Participating?
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0
 
hernst42Commented:
Which error do you get, does it work if you create the parser with:
$p = xml_parser_create('UTF-8');
0
 
tansofunAuthor Commented:
that only returns 1 or o.
i get a 0
0
 
hernst42Commented:
if the function returns 1 parsing into struct was succesfull (and all data is stored in $vals) what happens if you add at the beginning and you get as result 0:
error_reporting(E_ALL);
ini_set('display_errors', true);
0
 
tansofunAuthor Commented:
Neither comment helped, an upgrade of php fixed it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.