Regular gets the URL in the source code
Open it
There is a section in the source code, I would like to get the url/plus/ajax.php?open=2&id=826186 PHP is how to get, novice, look at the guidance
------Solution--------------------
PHP Code
$s = '
Open it';p reg_match_all ('/href= ' (. *?) " /I ', $s, $arr);p Rint_r ($arr);
------Solution--------------------
PHP Code
if (Preg_match_all ('/
.*? [^<]<\/a><\/li>/is ', $s, $match)) {//print_r ($match); $tmp = $match [1][0]; $tmp is the part you want//echo $tmp;}
------Solution--------------------
CSDN Master Too many, depression boring, I have not come and answer already someone hog first.
------Solution--------------------
Explore
PHP Code
if (Preg_match_all ('/
.*? [^<]<\/a><\/li>/is ', $s, $match)) {
Print_r ($match);
$tmp = $match [1][0]; $tmp is the part you want.
Echo $tmp;
}
------Solution--------------------
PHP Code
Brother also to a strong compatibility point of it. Preg_match_all ('/]*href\s*=\s*[\ ' "] ([^\ '" >]*) [\ ' "]/i ', $string, $matches); Var_dump ($matches [1]);
------Solution--------------------
I really do not want to answer this question, I suggest you take a good look at the regular expression ...
------Solution--------------------
Explore
PHP Code
Brother also to a strong compatibility point of it.
Preg_match_all ('/]*href\s*=\s*[\ ' "] ([^\ '" >]*) [\ ' "]/i ', $string, $matches);
Var_dump ($matches [1]);