Don't rush to answer, as i have just descovered the quite simple define() function which is working perfectly along with the defined() function. For all interested, the code i used was.
/* debug_echo.php */
<?php
function debug_echo($var)
{
if (defined(DEBUG_MODE))
{
echo "<pre>$var</pre>";
}
}
/* Example of usage:
define('DEBUG_MODE, true);
include 'debug_echo.php';
$var = 'This is working';
debug_echo($var);
When DEBUG_MODE is defined this will output:
"This is working"
So to toggle debug mode, just comment out the define line
*/
?>