PHP debug_backtrace() 函數 |
發布時間: 2012/9/1 17:32:27 |
定義和用法PHP debug_backtrace() 函數生成一個 backtrace。 該函數返回一個關聯數組。下面是可能返回的元素:
語法debug_backtrace() 例子<?php function one($str1, $str2) { two("Glenn", "Quagmire"); } function two($str1, $str2) { three("Cleveland", "Brown"); } function three($str1, $str2) { print_r(debug_backtrace()); } one("Peter", "Griffin"); ?> 電腦知識www.boydavid.com 輸出:
Array ( [0] => Array ( [file] => C:\webfolder\test.php [line] => 7 [function] => three [args] => Array ( [0] => Cleveland [1] => Brown ) ) [1] => Array ( [file] => C:\webfolder\test.php [line] => 3 [function] => two [args] => Array ( [0] => Glenn [1] => Quagmire ) ) [2] => Array ( [file] => C:\webfolder\test.php [line] => 14 [function] => one [args] => Array ( [0] => Peter [1] => Griffin ) ) ) 電 本文出自:億恩科技【www.artduck.net】 |