Hey Folks,
I have the following preg_match_all problem, I need an array of matches but instead I get one array index back with all matches glued on eachother. Let me visualize this.
The page looks something like this:
<a href=show.php?ID=3239&type=file>File1</a><br><a href=show.php?ID=3452&type=file>File2</a><br><a href=show.php?ID=3642&type=file>File3</a>
The part which I need are the ID's, which are 3239, 3452 and 3642, I wrote this preg for this:
preg_match_all("/<a href=show.php\?ID=(.)&type=file>(.)<\/a><br>/i", $contents, $links);
Strange enough this gives back an array of only one slice which looks like this: <a href=show.php?ID=3239&type=file>File1</a><br><a href=show.php?ID=3452&type=file>File2</a><br><a href=show.php?ID=3642&type=file>File3</a>
But instead I need an array of 3 slices (in this case) with only the ID numbers in it.
Ive been suffering now for 2 hours on this problem, I would be very grateful for a solution.
Thanks!
Johan