Download a file from web to local
Use this function to download a file from web to local machine.
function WgetFile( $URL, $dir )
{
$nomefile = $dir . "/" . basename( $URL );
if ( copy( $URL, $nomefile ) ) {
return true;
}
else {
return false;
}
}
//Save file to drive c:
WgetFile( 'http://vtwo.ir/src/v2-logo.png', 'c:/' );