//require_once("classes/mysql.php"); //$database = new db_mysql(); //$database->connect(); //$news = $database->list_assoc('SELECT id, title, description FROM news ORDER BY id DESC LIMIT 0,3'); function cut_text($str, $length=10, $trailing='...') { $length-=strlen($trailing); if (strlen($str) > $length) { return substr($str,0,$length).$trailing; } else { $res = $str; } return $str; } //print_r($news); ?>