doug Posted June 21, 2008 Share Posted June 21, 2008 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 More sharing options...
Ingolme Posted June 21, 2008 Share Posted June 21, 2008 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 More sharing options...
doug Posted June 21, 2008 Author Share Posted June 21, 2008 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;?> Thanks. file_get_contents() does work. I am still curious about the http_get() function though, described at http://jp2.php.net/manual/en/function.http-get.phpThanks,doug Link to comment Share on other sites More sharing options...
boen_robot Posted June 21, 2008 Share Posted June 21, 2008 This function is part of the pecl_http extension, which you must explicitly install. Link to comment Share on other sites More sharing options...
doug Posted June 21, 2008 Author Share Posted June 21, 2008 Ah. Well, that explains it. Thanks.doug Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.