Re: Google Style Search Results
| From: | dpgirago at mdanderson dot org | Date: | Wed, 07 Dec 2005 20:17:07 +0000 |
| Subject: | Re: Google Style Search Results | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-40789@lists.php.net to get a copy of this message | ||
It's possible that the keywords wouldn't be in the first X numbers of
characters.
|---------+------------------------------------------>
| | |
| | |
| | Joseph Crawford|
| | <codebowl@gmail.com>|
| | |
| | |
| | |
| | 12/07/2005 02:11 PM|
| | |
| | |
| | |
|---------+------------------------------------------>
>>-----------------------------------------------------------------------------------------------------------------|
|
|
|
|
|
|
|To:
|
| "[PHP-DB] Mailing List" <php-db@lists.php.net>
|
|cc:
|
|
|
|
|
|
|
|
|
|
|
|Subject:
|
| Re: [PHP-DB] Google Style Search Results
|
|
|
>>-----------------------------------------------------------------------------------------------------------------|
why not use substr?
$preview = substr($string, 0, 50) .'...';
it will probably cut off in the middle of a word, but you can use strpos
and
check to see if the char is a space to get to the point you want.
--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
codebowl@gmail.com