[PHP] Re: Get Value

2004-08-26 Thread Peter Brodersen
On Thu, 26 Aug 2004 09:41:28 +0530, in php.general [EMAIL PROTECTED] (Syed Ghouse) wrote: >Will anybody tell me how to extract the value (say Google) > from the code below: > >Google(value to extract) Instead of using regular expressions (and taking care of all exceptions), you might want to use

[PHP] Re: Get value between 2 strings

2003-11-17 Thread Al
Here's what I use: /** * get_text() * * $t The total text string * $s starting text string [e.g. ] * $e ending text string [e.g. * * @return the extracted text string. [e.g., returns string between start and end texts. */ function get_text($text, $s, $e) // Get string out of text { $sp = strp

[PHP] Re: Get value between 2 strings

2003-11-17 Thread Lucian Cozma
This should do the trick: $line = "I want the value between word ONE and word TWO. Please return it..."; preg_match('/ONE(.*)TWO/i', $line, $ret); print_r($ret); "Matt Palermo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. I was wondering if anyone knew of a function to g