Link to home
Start Free TrialLog in
Avatar of SRIKANTH MADISHETTI
SRIKANTH MADISHETTIFlag for India

asked on

reading xml content from a url

i have a url

and  it has xml content

i want to read this xml content usign php

can any one please help me out

Thank you

Srikanth
Avatar of Roonaan
Roonaan
Flag of Netherlands image

You can just use:

$xml = file_get_contents('http://domain.com/xmlfile.xml');

-r-
Avatar of SRIKANTH MADISHETTI

ASKER

<?php
$xml = file_get_contents('http://preisvergleich.guenstig.de/xservice/getCategoryList.do?version=2.3');
?>

iam tryign to read like this it throws errors

thatz the url from where i need to read the xml content and i want the seperated content
What kind of errors. The url seems to work for me.

-r-
ASKER CERTIFIED SOLUTION
Avatar of CaveyCoUk
CaveyCoUk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in D:\guenstig\guenstig1\gunxml.php on line 4

Warning: file_get_contents(http://preisvergleich.guenstig.de/xservice/getCategoryList.do?version=2.3): failed to open stream: No such file or directory in D:\guenstig\guenstig1\gunxml.php on line 4

this is the error it gives to me
i kept the allow_url_fopen- on in php.ini file but still i get the same error.

but i want to know after reading the file using file_get_contents how can i get the seperated content like we have starting tag ending tags <itmes></itmes> so i want all the contents of this xml contents
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial