copy() - Makes a copy of the file source to dest.
copy(string $source,string $dest) where, $source = Path to the source file. $dest = The destination path.If the destination file already exists, it will be overwritten. Returns TRUE on success or FALSE on failure.
copy('http://example.com/image.php', 'local/folder/flower.jpg');Note: Make sure allow_url_fopen is on.
Read more on http://php.net/manual/en/function.copy.php for detail explanation.