Using the regular expression of PHP to implement:
$content = ' Here is the content of the article, insert here a picture test ';
$content = Stripslashes ($content);
$img _array = Array ();
Match all remote pictures
Preg_match_all ("/(src| SRC) =["| ' |] {0,} (http://(. *). (gif|jpg|jpeg|bmp|png)) /isu ", $content, $img _array);
$img _array = array_unique ($img _array [2]) that match out the non-duplicate picture;
Print_r ($img _array);
It matches the remote picture, and we need to keep it local. Here are two points to note:
1. Picture save path (Picture storage directory)
2. Actual access to picture address
Here is the complete example: (You can save to the local server to modify the appropriate place for testing)
Above is the PHP is matching the remote picture address in the article and download pictures to the local implementation skills, I hope to help you learn.