How can I find the smallest variable instead of the smallest value? how can I find the smallest variable instead of the smallest value? the location of the minimum value is also acceptable. For example: $ a1; $ b2; $ c3; how can I find the smallest variable instead of the smallest value?
How can I find the smallest variable instead of the smallest value? the location of the minimum value is also acceptable.
For example:
$ A = 1;
$ B = 2;
$ C = 3;
Share:
------ Solution --------------------
$ _ 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); //
------ Solution --------------------
Print the variable name after obtaining the variable
Function varName ($ v ){
$ Trace = debug_backtrace ();
$ VLine = file (_ FILE __);
$ FLine = $ vLine [$ trace [0] ['line']-1];
Preg_match ("# \\$ (\ w +) #", $ fLine, $ match );
Print_r ($ match );
}