Skip to content

Instantly share code, notes, and snippets.

@clcneogeek325
Created May 10, 2018 18:07
Show Gist options
  • Save clcneogeek325/d0781691776c87bb23038ebc9b83b0ed to your computer and use it in GitHub Desktop.
Save clcneogeek325/d0781691776c87bb23038ebc9b83b0ed to your computer and use it in GitHub Desktop.

Revisions

  1. NEO created this gist May 10, 2018.
    11 changes: 11 additions & 0 deletions php_curl_get.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?php

    $ch = curl_init("http://www.example.com/");
    $fp = fopen("example_homepage.txt", "w");

    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);

    curl_exec($ch);
    curl_close($ch);
    fclose($fp);