- substr: documentation ( source)
- print_r: documentation ( source)
- array_shift: documentation ( source)
<?php
$e = new Exception ();
$stack = $e -> getTrace ();
print_r($stack);
$exclude = 'foo.php';
while (isset ($stack [0])
&& ($exclude === substr ($stack [0] ['file'], -strlen($exclude))
|| 'error_handler' === $stack [0] ['function']))
{
array_shift ($stack);
}