I have a very simple debugging function that I wrote, that doesn't work.
$debug_On = true;
function debug($debug_line) {
if ($debug_On == true) {
echo $debug_line."<br>";
} else {
//don't print
}
}
When I test for the condition "true", it doesn't ever echo the line.
When I set $debug_On to "true" or "false" and check for 0, it always echos the line.
When I set $debug_on to 0 or 1, and check for 0, it always echos the line.
The function is the first thing on my page, and I reference it by
debug($somevar);
Am I just missing something obvious? (I know I don't need the else clause, but it doesn't work when I take that out, either.)
Thanks
Sarah