Re: content search and grab

From: Date: Fri, 24 Nov 2000 23:11:12 +0000
Subject: Re: content search and grab
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27055@lists.php.net to get a copy of this message
<? $str=" foo yxz:<Font size=2>$123,452 foo Networth:<font color=red>$1,258,125 foo "; preg_match_all("/(.*):<Font.*>(.*)/i",$str,$matchin); for($i=0;$i<count($matchin[0]);$i++){ print "{$matchin[1][$i]}={$matchin[2][$i]} <BR>\n"; } ?> for example. this would output: yxz=$123,452 Networth=$1,258,125 regards Folke -- Folke Ashberg Stage Internet Services GmbH Technical Development folke@fanstage.de folke@fanstage.de | Tel: +49 89 454591-77 | Fax: +49 89 454591-71 Kreillerstr. 21 | 81673 Munich | Germany | www.fanstage.de On Fri, 24 Nov 2000, Ian LeBlanc wrote: > In recent days I have been working on a site that wants me to allow > users to input text into a large text box and have the code parse what > is there and get the info out of it that it needs... > > Here is the big question I have > > the line say Networth: $1,258,125 > > Now I know I can find Networth in the script. > It is only entered once, but how can I grab the actual value (1,258,125) > and put it into a varible? > > Believe me I have been looking and trying to get this to work for 2 > weeks now. > When you send me an answer I should also tell you there is a font tag > inbetween the Networth: and the value. > > Please help... > > Thanks > > >

« previous php.general (#27055) next »