Re: Google Style Search Results

From: Date: Wed, 07 Dec 2005 21:07:27 +0000
Subject: Re: Google Style Search Results
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-40791@lists.php.net to get a copy of this message
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. It's possible that the keywords wouldn't be in the first X numbers of characters.
Then use strstr() to find the first occurence of the first keyword and then use substr with an initial offset... -philip

« previous php.db (#40791) next »