aboutsummaryrefslogtreecommitdiff
path: root/library/functions.php
blob: 9ea37b131c5ec49d000612d52aa79dec1bddee93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

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;
}

function session_set() {
    if(isset($_SESSION['user_id']) && $_SESSION['user_id'] != "") {
        return true;
    }
}
?>