aboutsummaryrefslogtreecommitdiff
path: root/library/functions.php
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-04-07 11:49:12 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2021-04-07 11:49:12 +0300
commitfd4cb27121122d146b8cc3d55ad5aa9312c2cbe6 (patch)
tree9a6b58cabe2320d8b385196a68ab973803199eac /library/functions.php
downloadbugtracker-fd4cb27121122d146b8cc3d55ad5aa9312c2cbe6.tar.xz
Initial commit
Diffstat (limited to 'library/functions.php')
-rw-r--r--library/functions.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/library/functions.php b/library/functions.php
new file mode 100644
index 0000000..ee3a0d0
--- /dev/null
+++ b/library/functions.php
@@ -0,0 +1,15 @@
+<?php
+session_start();
+
+function truncate($text, $chars = 25) {
+ if (strlen($text) <= $chars) {
+ return $text;
+ }
+ $text = $text." ";
+ $text = substr($text,0,$chars);
+ $text = substr($text,0,strrpos($text,' '));
+ $text = $text."...";
+ return $text;
+}
+?>
+