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...
-
Many of these technologies don't look anything like today's gadgets. Instead, they are stretchable, bendable and incredibly th...
No comments:
Post a Comment