function Truncate added

missing function added to functions lib.
This commit is contained in:
Lee 2021-01-04 12:42:13 +00:00
parent 469a8c1017
commit 8c06bd1738

View File

@ -1445,6 +1445,14 @@ function between($x, $lim1, $lim2) {
return (($x >= $lower) && ($x <= $upper));
}
function truncate($string, $length)
{
if (strlen($string) > $length) {
$string = substr($string, 0, $length) . '...';
}
return $string;
}
// validator functions
require_once LIBS . 'validator.php';
require_once SYSTEM . 'compat.php';