Thomisback Posted June 1, 2008 Share Posted June 1, 2008 Hi, I'm trying to grab the values of some links, the problem is that it only gives me the first link. I want all the links. The code if (preg_match('%<br><br></TD><TD width="120" align="center" valign="top"><A href="(.*?)">%', $data, $regs)) { $type = $regs[1]; } else { $type = ""; } I already tried a foreach statement but still only returns 1 value. Thanks Quote Link to comment Share on other sites More sharing options...
joquius Posted June 1, 2008 Share Posted June 1, 2008 preg_match_all ($pat, $str, $matches) matches are returned in the format of $matches[sub pattern index] = sub pattern matches Quote Link to comment Share on other sites More sharing options...
Thomisback Posted June 1, 2008 Author Share Posted June 1, 2008 Thanks i'm going to have a look at it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.