How can I use PHP to download files from the network to the server where the PHP file is located? For example, if php file A is on server A and server B has an image A, its address is http://www.xxx.xx/images/xx.jpg. Which function can be used to download image A to server A after php file A is executed? By the way, find a complete Chinese PHP function manual ., How does PH use PHP to download files from the network to the server where the PHP file is located?
For example, if php file A is on server A and server B has an image A, its address is http://www.xxx.xx/images/xx.jpg.
Which function can be used to download image A to server A after php file A is executed?
By the way, find a complete Chinese PHP function manual.
------ Solution --------------------
PHP code
$ Content = file_get_contents ("http://www.xxx.xx/images/xx.jpg"); file_put_contents ("img.jpg", $ content );