Last active
August 31, 2020 11:22
-
-
Save synackme/8375590 to your computer and use it in GitHub Desktop.
Downloading a file from the Web with fopen() and fgets()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Define the file you want to download | |
$target = "http://www.WebbotsSpidersScreenScrapers.com/hello_world.html"; | |
$file_handle = fopen($target, "r"); | |
# Fetch the file | |
while (!feof($file_handle)) | |
echo fgets($file_handle, 4096); | |
fclose($file_handle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment