Re: Getting an argument out of a web page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux