Solved

Why does xml_parse_into_struct fail on this page?

Posted on 2006-11-30
6
686 Views
Last Modified: 2008-01-09
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);
?>
0
Comment
Question by:tansofun
  • 2
  • 2
6 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 18052403
Which error do you get, does it work if you create the parser with:
$p = xml_parser_create('UTF-8');
0
 
LVL 2

Author Comment

by:tansofun
ID: 18052407
that only returns 1 or o.
i get a 0
0
 
LVL 48

Expert Comment

by:hernst42
ID: 18052519
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
 
LVL 2

Author Comment

by:tansofun
ID: 18116065
Neither comment helped, an upgrade of php fixed it.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18473064
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP: Insert Data into MySQL 5 40
Php recording post 4 45
google analytics on wp-admin password protected area 2 23
how to use Initialization Vector for openssl_encrypt() 5 26
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question