Results 1 to 3 of 3

Thread: [RESOLVED] file_get_contents help

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Resolved [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

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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>'

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    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
  •  



Click Here to Expand Forum to Full Width