note 25866 added to function.substr
| From: | howard at rack1 dot php dot net | Date: | Wed, 09 Oct 2002 12:32:20 +0000 |
| Subject: | note 25866 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37839@lists.php.net to get a copy of this message | ||
in response to the getting x number of words, you could explode($str," ") to split a
string into an array of words
eg:
$bah = explode(" ", "hello i am bob");
for($i=0 ; $i<strlen($bah) ; $i++)
{
echo "[$bah[$i]]<br />";
}
returns:
[hello]
[i]
[am]
[bob]
[]
--
http://www.php.net/manual/en/function.substr.php
http://master.php.net/manage/user-notes.php?action=edit+25866
http://master.php.net/manage/user-notes.php?action=delete+25866
http://master.php.net/manage/user-notes.php?action=reject+25866