On a phpBB forum, memberlist.php lists all the members of the board with the following HTML:
<a href="profile.php?mode=viewprofile&u=4">Username</a>
Where u=4 is the UserID of the user, and Username is obviously their username.
There are probably 50-100 peices of HTML like this and I would like to match them all, so I was going to use preg_match_all
.
This is what I got:
preg_match_all('/<a href="profile\.php?mode=viewprofile&u=/d">(.*?)</a>/', $page, $usrname, PREG_PATTERN_ORDER);
But it returns this error:
Warning: preg_match_all() [function.preg-match-all]: Unknown modifier 'd' in C:\xampp\htdocs\index.php on line 38
Could anyone tell me the regex to use in the preg_match_all
function to match the usernames? Bearing in mind the u=4
part of the link will change :)
Cheers.