<?php
class util{
    public static function 
get_filename($path){
        if (
$pos strrpos($path'/') === false){
            
$pos strrpos($path'\\');
        }
        if (
$pos === false)
            return 
$path;
        return 
substr($path$pos+1);
    }

    public static function 
str_backtrace(array $trace){
        
$output = array();
        foreach (
$trace as $array){
            
$output[] = '<strong>function:</strong> '.$array['function'].'() <strong>page:</strong> '.self::get_filename($array['file']).' <strong>line:</strong> '.$array['line'];
        }
        return 
implode('<br />'$output);
    }
}
?>