Any direct method to get previous variable name ?
$a = "";
$b = "";
if (logic) {
$result = $a;
} elseif (logic) {
$result = $b;
}
any direct_function($result)
can get "a" or "b" ?
Many thanks.
Any direct method to get previous variable name ?
$a = "";
$b = "";
if (logic) {
$result = $a;
} elseif (logic) {
$result = $b;
}
any direct_function($result)
can get "a" or "b" ?
Many thanks.
If i get your question then i think the Best way is to use an array().
For example:
$a = "";
$b = "";
$result=array(); // an empty array
if (logic) {
$result[] = $a;
} elseif (logic) {
$result[] = $b;
}
Now you can get any value by index.