Back to PhocacartUtils class

Method wordDelete

public static
wordDelete
(mixed $string, mixed $length, mixed $end)

Method wordDelete - Source code

public static function wordDelete($string, $length, $end)
{
    if (strlen($string) < $length || strlen($string) == $length) {
        return $string;
    } else {
        return substr($string, 0, $length) . $end;
    }
}