...

View Full Version : Showing only a certain amount of characters from a value



ole90
11-10-2007, 10:03 PM
I'm trying to display the description of someones article. I want to take the first 100 characters of their article and use it as their description, so my question is, is there a function that allows me to limit 100 characters of a value.

Thanks

Mwnciau
11-10-2007, 10:43 PM
$string = substr($string, 0, 100);

substr() (http://uk2.php.net/manual/en/function.substr.php)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum