Copy Image From Remote Server To Local
PHP function to save an image from a remote source then download it to the local server that the script is on.
Copy this code and paste it in your HTML
<?php
function save_image($inPath,$outPath)
{ //Download images from remote server
$in= fopen($inPath, "rb"); $out= fopen($outPath, "wb"); while ($chunk = fread($in,8192)) {
}
}
?>
Report this snippet
Comments
Subscribe to comments