note 18858 deleted from function.substr by nlopess
| From: | nlopess@php.net | Date: | Sat, 26 Jun 2004 13:16:55 +0000 |
| Subject: | note 18858 deleted from function.substr by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71761@lists.php.net to get a copy of this message | ||
Note Submitter: kevin@intuitive.net
----
PHP really needs a substr_index function to return x number of words from a string.
One workaroung is by using mysql:
select SUBSTRING_INDEX(field, ' ', 50) FROM tablename
The " " is what you wish to index, this this case a space. "50" is the amount of
words you wish to return