note 104613 deleted from function.substr by danbrown
| From: | danbrown@php.net | Date: | Sun, 26 Jun 2011 15:58:58 +0000 |
| Subject: | note 104613 deleted from function.substr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180962@lists.php.net to get a copy of this message | ||
Note Submitter: alex dot audu at garlandnetworx dot com
----
I used the following to return the first word in a string of words up to the first occurence of a
delimiter character.
$firstWord = substr($wString, -strlen($wString, $delimiter);
For example: for
$wString = "This is great";
$delimiter = " ";
Then $firstWord = "This"
Cheers.
Alex.