At 13:48 18/01/01 +, jalist wrote:
>I'm trying to grab a string from within a string based on a matching word or
>phrase. Example...
>
>$string = "This is a string I need to grab the middle out of"
>$query_word = "need"
>
>I need to get x amount of characters either side of $query_word, so the
"jalist" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Date sent: Thu, 18 Jan 2001 16:12:31 -
Subject:RE: [PHP] (Newbie) String within a string
> Excellent, thanks a lot Chris.
>
> Steve
> (jalis
Excellent, thanks a lot Chris.
Steve
(jalist)
[EMAIL PROTECTED]
http://ls2k.org
-Original Message-
From: Chris Hayes [mailto:[EMAIL PROTECTED]]
Sent: 18 January 2001 15:43
To: jalist; PHP
Subject: Re: [PHP] (Newbie) String within a string
jalist:
> I'm trying to grab a str
jalist:
> I'm trying to grab a string from within a string based on a matching word or
> phrase. Example...
You say you want the middle, not two words before and two words after.
I see several ways.
1. Explode into an word-array and use that:
1. prepare string
I'm trying to grab a string from within a string based on a matching word or
phrase. Example...
$string = "This is a string I need to grab the middle out of"
$query_word = "need"
I need to get x amount of characters either side of $query_word, so the
result string would be like...
"string I nee
5 matches
Mail list logo