I need to save an image from a PHP URL to my PC. Let\'s say I have a page, http://example.com/image.php, holding a single \"flower\" image, nothing else. How ca
http://example.com/image.php
$img_file='http://www.somedomain.com/someimage.jpg' $img_file=file_get_contents($img_file); $file_loc=$_SERVER['DOCUMENT_ROOT'].'/some_dir/test.jpg'; $file_handler=fopen($file_loc,'w'); if(fwrite($file_handler,$img_file)==false){ echo 'error'; } fclose($file_handler);