Re: How can i hightlight an stacktrace error/exception?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mathijs wrote:
> Hello there,
> 
> Is there a way to color exceptions/errors? 

I recommend a combination of php & html (maybe with some css and
javascript thrown in for good measure)

e.g. (ripped straight from zend.com):

<?php

        function printException(Exception $e) {
            print "<h1>".get_class($e)."</h1>\n";
            print "<h2>{$e->getMessage()}
                ({$e->getCode()})</h2>\n\n";
            print "file: {$e->getFile()}<br />\n";
            print "line: {$e->getLine()}<br />\n";
            print $e->getTraceAsString();
        }

?>

STFW if you want something more sophisticated.

> I try d to use highlight_string() but that only works on PHP code.
> 
> Does someone has a function or something which can do this?
> 
> Thx in advance.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux