Using this function we can extract first $lemgth words from $string
<?php
function wordlimit($string, $length = 50, $ellipsis = "...")
{
$words = explode(' ', $string);
if (count($words) > $length)
return implode(' ', array_slice($words, 0, $length)) . $ellipsis;
else
return $string;
}
?>
Friday, June 26, 2009
Php - How to display first n words of a paragraph ...
Subscribe to:
Post Comments (Atom)
Popular Hybrid Mobile App development frameworks
Popular Hybrid Mobile App development frameworks Hybrid Development Technologies List of best Hybrid App Development Frameworks ...
-
Popular Hybrid Mobile App development frameworks Hybrid Development Technologies List of best Hybrid App Development Frameworks ...
-
NEW YORK: Tracking melting glaciers, deforestation or disappearing elephants has been made easier as Google has now allowed access to real t...
-
There are two displays here: a 24-inch LCD capable of 1080p and a 46-inch LCD with up to 4K resolution. Adjacent literature was at least...
No comments:
Post a Comment