mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +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));
|
return (($x >= $lower) && ($x <= $upper));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function truncate($string, $length)
|
||||||
|
{
|
||||||
|
if (strlen($string) > $length) {
|
||||||
|
$string = substr($string, 0, $length) . '...';
|
||||||
|
}
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
// validator functions
|
// validator functions
|
||||||
require_once LIBS . 'validator.php';
|
require_once LIBS . 'validator.php';
|
||||||
require_once SYSTEM . 'compat.php';
|
require_once SYSTEM . 'compat.php';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user