/* Below function For Truncate string */
function truncate($text, $chars) {
$add_dots='';
if(strlen($text) > $chars){
$add_dots = "...";
}
$text = str_replace('"','”',$text);
$text = str_replace('"','“',$text);
$text = str_replace("\n", "", $text);
$text = str_replace("\r", "", $text);
$text = $text." ";
$text = substr($text,0,$chars);
$text = substr($text,0,strrpos($text,' '));
$text = $text.$add_dots;
return $text;
}
/*Function for refine tag and quotes in description. */
function refineTagQuotes($text)
{
$text = str_replace('"','”',$text);
$text = str_replace('"','“',$text);
$text = str_replace("\n", "", $text);
$text = str_replace("\r", "", $text);
return $text;
}
function truncate($text, $chars) {
$add_dots='';
if(strlen($text) > $chars){
$add_dots = "...";
}
$text = str_replace('"','”',$text);
$text = str_replace('"','“',$text);
$text = str_replace("\n", "", $text);
$text = str_replace("\r", "", $text);
$text = $text." ";
$text = substr($text,0,$chars);
$text = substr($text,0,strrpos($text,' '));
$text = $text.$add_dots;
return $text;
}
/*Function for refine tag and quotes in description. */
function refineTagQuotes($text)
{
$text = str_replace('"','”',$text);
$text = str_replace('"','“',$text);
$text = str_replace("\n", "", $text);
$text = str_replace("\r", "", $text);
return $text;
}
No comments:
Post a Comment