PHP questions & answers

PHP is a server-side scripting language designed for producing web pages
A
Question by Arockia selvi
383 views
July 29, 2008
A
Answer by Alex Urbach

An error control operator stores and logs all the errors in an error log making it easier for you to track down the output error the script may give.


The standard PHP code for an error control operator is:


/* Intentional file error */
$my_file = @file ('non_existent_file') or
die ("Failed opening file: error was '$php_errormsg'");
// this works for any expression, not just functions:
$value = @$cache[$key];
// will not issue a notice if the index $key doesn't exist.
?>

-- Source code © PHP.NET


This code needs to be implemented with additional variables so that it tracks and displays the errors as they happen. For more information you can check the official PHP manual available on the homepage of the developer.

See more questions & answers

Ask a question about PHP

Alternative downloads

Zend Guard
rating

Zend Guard, the most widely accepted PHP encoding and obfuscation product

Zend Core
rating

Complete web server components package for multiple platforms.

ByteRun Protector for PHP
rating

All scripts protected by this program are converted to bytecode and encrypted.