Posted by Adam on 10/25/61 11:28
I've cobbled a sort of global "debug" routine by using this function:
function debug($str, $strname) {
global $debugYN;
if ($debugYN) {
echo "<br>[Debug (<span
style=\"color:red\">$$strname</span>) : <strong>$str</strong>]<br>";
}
}
This function gets included (usually in a header) and then called by
setting $debugYN = 1 wherever I want to start viewing variable info -
calling the function with:
debug($foo, "foo");
I'm having to pass two values - the value of the variable AND it's
name. Is there a way of extracting the NAME of the variable ("foo" in
this case) without having to pass it?
Adam.
Navigation:
[Reply to this message]
|