Displaying errors
May 7th, 2008 | Published in Code Development, PHP
<?php
$isDev = $_SERVER['HTTP_HOST'] == ‘dev.phpguru.org’;
$isLive = $_SERVER['HTTP_HOST'] == ‘www.phpguru.org’;
if ($isDev) {
error_reporting(E_ALL);
ini_set(‘display_errors’, 1);
} elseif ($isLive) {
error_reporting(0);
ini_set(‘display_errors’, 0);
}
?>
sometimes the simple ways are the best ways. I do some very similar things build on this same approach…
