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...
-
AI GPS positioning, touch display and more for Yuan 199 Only available in China now. The Mi Children's Watch 2S has a squarish ...
No comments:
Post a Comment