Re: parts of sentences
| From: | Robert Cummings | Date: | Wed, 09 Oct 2002 13:59:05 +0000 |
| Subject: | Re: parts of sentences | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119434@lists.php.net to get a copy of this message | ||
Oliver Witt wrote:
>
> Hi,
> I have a problem that I don't know how to solve within php.
> I have the variable $x = "How are you today" and the variable $y. Now, I
> want the variable to be $y = "are you today" or $y = "you today". How do
> I do that?
$y = ereg_replace( '^[[:space:]]*[[:alpha:]]+[[:space:]]+', '', $x );
Unless you had more exotice needs. There may even be a word chop function
since I didn't bother to look :)
Cheers,
Rob.
--
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer |
:----------------------------------------------:
| Mail : mailto:robert.cummings@webmotion.com |
| Phone : (613) 731-4046 x.109 |
:----------------------------------------------:
| Website : http://www.webmotion.com |
| Fax : (613) 260-9545 |
`----------------------------------------------'