mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
function Truncate added
missing function added to functions lib.
This commit is contained in:
parent
469a8c1017
commit
8c06bd1738
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user