Welcome Guest, Not a member yet? Register   Sign In
preg_match not working we want to choose second title but it choose 1.
#4

(This post was last modified: 06-15-2019, 11:01 AM by jreklund.)

I don't know what more you are fetching from the site. But this will find both url and title for you.

Code:
$re = '@href="/?(video[0-9]+[^>]+)" title="(.*?)">@m';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);

And in your case, if you don't want it to do multiple things.
Code:
@p class="title">\s*<a.*?title="(.*?)">@
Reply


Messages In This Thread
RE: preg_match not working we want to choose second title but it choose 1. - by jreklund - 06-15-2019, 10:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB