The regular wording of asking for advice
$str = '
Inexplicable
Fans: 932
Venture capital person
Yat Sen <
Fans: 993
Financial
King
Fans: 1093
IT
';
How does this string match the url,imgurl,name,fans,job of each Li, such as the first
Should be matched separately out of Http://aaa.com/iclock,/images/j22.jpg, inexplicable, 932, venture capitalists.
------Solution--------------------
PHP Code
[User:root time:06:22:25 path:/home/liangdong/php]$ php preg.php Array ([0] = = Array ([0] = =
Inexplicable
Fans: 932
Venture capital person
[1] = = http://aaa.com/moming [2] =/images/j22.jpg [3] = [4] + = fan: 932 [5] = = Venture capital person) [1] = = Array ([0] = =
Yat Sen <
Fans: 993
Financial
[1] [+] = Http://aaa.com/yxian [2] =/images/j7.jpg [3] + Yat Sen < [4] = fan: 993 [5] = finance) [2] = = Array ([0] = =
King
Fans: 1093
IT
[1] = HTTP://AAA.COM/IKCO [2] =/images/j2.jpg [3] = Kings [4] + fans: 1093 [5] = = IT)) [User:root time:06:22:26 path:/home/liangdong/php]$ Cat preg.php
Inexplicable
Fans: 932
Venture capital person
Yat Sen <
Fans: 993
Financial
King
Fans: 1093
IT
EOF; $n = Preg_match_all ('/
.*. *.*.*<\/a>.*<\/p>.* (. *) <\/p>.* (. *) <\/p>.*
(. *) <\/p>.*<\/li>/ius ', $str, $matches, Preg_set_order); if ($n) {print_r ($matches);}? >