Net_Curl
[ class tree: Net_Curl ] [ index: Net_Curl ] [ all elements ]

Source for file fetchPage.php

Documentation is available at fetchPage.php

  1. <?php
  2.  
  3. // php -q fetchPage.php http://www.example.com
  4. //
  5. // Fetches the URL passed to the constructor and echoes it out.
  6.  
  7. require_once('Net/Curl.php');
  8.  
  9. $curl new Net_Curl($argv[1]);
  10. $result $curl->create();
  11. if (!PEAR::isError($result)) {
  12.  
  13.     // Set other options here with Net_Curl::setOption()
  14.  
  15.     $result $curl->execute();
  16.     if (!PEAR::isError($result)) {
  17.         echo $result."\n";
  18.     else {
  19.         echo $result->getMessage()."\n";
  20.     }
  21.  
  22.     $curl->close();
  23. else {
  24.     echo $result->getMessage()."\n";
  25. }
  26.  
  27. ?>

Documentation generated on Mon, 11 Mar 2019 15:21:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.