I'm having trouble fetching a url from a webpage. Perhaps someone can show me what I'm missing. I read the page in as a file, then convert it to a string. From there I use eregi to get the url that I'm interested in. I don't know what the querysting will be so I'm trying to terminate the lookup on the double quote used in a href tag.
For example:
<a href="www.somepage.com?querytring">
Here's what I've come up with:
eregi("(http://www.somepage.com\?(.*)(\"){1}",$str,$out);
Unfortunately, the match is not stopping at the first double quote encountered -- it stopping at the last double quote in the page.
Where am I going wrong?
Your advice will be greatly appreciated.
Thanks,
Andrew