+ function rec_join ($arg) {
+ if ( is_array($arg) ) {
+ $ret = "";
+ foreach ( $arg as $i ) {
+ $l = $this->rec_join($i);
+ # ignore html code.
+ if ( $l[0] != "<" ) { $ret .= $l . ", "; }
+ }
+ return $ret;
+ } else {
+ settype($arg, "string");
+ return $arg;
+ }
+ }
+
+ function backtrace_php () {
+ $backtrace = debug_backtrace();
+ $msg = "";
+ foreach( $backtrace as $line ) {
+ $msg .= "File '". $line['file'] . "' line " . $line['line'] . "\n";
+ $msg .= " " . $line['function'] . "( " . $this->rec_join($line['args']) . ")\n";
+ }
+ return $msg;
+ }
+