日期:2014-05-17 浏览次数:20535 次
$_t = get_defined_vars();
$a=1;
$b=2;
$c=3;
$t = array_diff_key(get_defined_vars(), $_t, array('_t' => ''));
echo array_search(min($t), $t); //a
function varName( $v ) {
$trace = debug_backtrace();
$vLine = file( __FILE__ );
$fLine = $vLine[ $trace[0]['line'] - 1 ];
preg_match( "#\\$(\w+)#", $fLine, $match );
print_r( $match );
}