first commit
This commit is contained in:
14
application/helpers/hoosk_admin_helper.php
Executable file
14
application/helpers/hoosk_admin_helper.php
Executable file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
if(!function_exists('wordlimit')) {
|
||||
function wordlimit($string, $length = 40, $ellipsis = "...")
|
||||
{
|
||||
$string = strip_tags($string, '<div>');
|
||||
$string = strip_tags($string, '<p>');
|
||||
$words = explode(' ', $string);
|
||||
if (count($words) > $length)
|
||||
return implode(' ', array_slice($words, 0, $length)) . $ellipsis;
|
||||
else
|
||||
return $string.$ellipsis;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user