|
-
Jul 22nd, 2010, 04:13 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] file_get_contents help
Hi friends,
when i try to use this code
Code:
$cont = file_get_contents("http://google.com");
echo $cont;
it works fine and display google site. But how can i get the contents of an XML file? with the same code.
Code:
$cont = file_get_contents("http://site.com/XMLFILE.xml");
echo $cont;
i does not get the contents of XML file. Please help me to get it working
-
Jul 22nd, 2010, 05:34 PM
#2
Re: file_get_contents help
it does get the contents of the XML file. XML is mark-up, like HTML, and would not necessarily be displayed by the browser as an XML file might normally be displayed because you're not sending a header that tells the browser it is, indeed, an XML file, and not a PHP file.
PHP Code:
echo '<xmp>' . $cont . '</xmp>';
-
Jul 23rd, 2010, 01:43 PM
#3
Thread Starter
Fanatic Member
Re: file_get_contents help
Thanks friend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|