$content=file_get_contents($imagelink); $handle=fopen('resimler/'.$filename.'.jpg', 'w+'); fwrite($handle, $content);