Jump to content

Trivial http_get() test fails - why?


doug

Recommended Posts

The following very trivial (I thought) http_get() test fails:

<?php$body = http_get('http://www.nytimes.com');echo $body;?>

The error returned is:Fatal error: Call to undefined function http_get() in /home/doug/public_html/inpac/tests/httpRequest1.php on line 3I found http_get in the online PHP manual. Is it not a global, standard function?Thanks,doug

Link to comment
Share on other sites

I have never heard of that function before, but then, PHP is a very vast language.You probably want this function:

<?php$body = file_get_contents('http://www.nytimes.com');echo $body;?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...