How can I do the following? For example I have this text (it’s a source code):
Welcome to asdfasdf, <h2>Welcome</h2>, <a href="index.php?my_id=1">Homepage</a>,
<br />, Hi, this is some text.
Check <a href="index.php?my_id=12945">this link</a> or
<a href="index.php?my_id=138>this link</a> for more information.
<br /><strong>Thanks</strong>
Now I would like to search this string with php for “my_id” and display all the id’s. So the output would be:
1
12945
138
Hope you understand me. Thanks!
Here it is:
My regexp is not very strict, but it requires that ?my_id=123 appears inside
<a>tag.