PHP gets all the pictures in the web page by regular expression (the repeating value in the array).
PHP to get all the pictures in a web page through regular expressions, the functions used are: the file_get_contents () function reads the entire file into a string, the preg_match_all function matches the global regular expression, array_uni The que function removes the repeated values in the array
[code].lt;? PHP
$url=.quot; http://sports.qq.com/photo/? Pgv_ref=aio.quot;
//file_get_contents () function reads the entire file into a string; Local regular expression matching.
preg_match_all (.Quot; /.lt;.#91; ^.gt;.#93; *) \s*src= (.#91; ^'\.quot; >);
$new_arr=array_unique ($matches.#91; 0.#93;); / / / / / / foreach,
foreach ($new_arr as $key) {
echo $key..Quot;