Get all link id from html source code using PREG_MATCH_ALL

Posted by Jeremy Dicaire on Stack Overflow See other posts from Stack Overflow or by Jeremy Dicaire
Published on 2011-01-08T04:24:23Z Indexed on 2011/01/08 4:53 UTC
Read the original article Hit count: 180

Filed under:
|
|

Hi there,

I know i shouldn't do this that way but its just to retrieve all id of my links since i have a lot of them

Here is the patern: <a href="mylink.php?get=123456">Click 1</a> <a href="mylink.php?get=222222">Click 2</a> <a href="mylink.php?get=81456">Click 3</a> <a href="mylink.php?get=1700">Click 4</a>

I want to get all "get=" values (123456, 222222, etc.) And also the "Click 1", "Click 2", etc values using Preg_match_all()

Any idea?

Thanks a lot guys!!!

© Stack Overflow or respective owner

Related posts about php

Related posts about regex