Brian Dunning wrote:
I'm trying to read a MySpace FriendID out of a web page. If you view the
source, you see this is multiple places:
.....&friendID=12345&....
What's the simplest way to extract the FriendID and stick it in a
variable? Is there a regex that would do this?
Is it always in that format?
preg_match ( "/&friendID=(\d{5,})&/", $source, $id );
The result will be in $id[1].
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php