tansofun
asked on
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);
?>
<?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
$x = xml_parse_into_struct($p, $content, $vals, $index);
xml_parser_free($p);
?>
ASKER
that only returns 1 or o.
i get a 0
i get a 0
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);
error_reporting(E_ALL);
ini_set('display_errors', true);
ASKER
Neither comment helped, an upgrade of php fixed it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$p = xml_parser_create('UTF-8')