Re: Getting an argument out of a web page

From: Date: Mon, 11 Sep 2006 16:55:53 +0000
Subject: Re: Getting an argument out of a web page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-241610@lists.php.net to get a copy of this message
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@dotcomholdingsofbuffalo.com

« previous php.general (#241610) next »