php-Error Control Operators

PHP gives one error control operator: the at sign (@).Any error messages that might be generated by that expression will be ignored.
If you have set a custom error handler function with set_error_handler() then it will still get called, but this custom error handler can call error_reporting() which will return 0 when the call that triggered the error was preceded by an @. 

<?php/* Intentional file error */$test_file = @file ('no_existent_file') or
    die (
"Failed opening file: error was '$php_errormsg'");
// this works for any expression, not just functions:$val22 = @$cache[$key];// will not issue a notice if the index $key doesn't exist.
?> 
 
or  
add  error_reporting()  in the script

Related Posts:
  • Check if image file ?? allow_url_fopen is activated in your PHP config     $filename = "http://".$_SERVER['SERVER_NAME']." /media/img/".$row['CatNaam'].".jpg"; echo" <img src=\"".$filename."\" alt=\"".$row['CatNaam']."\">"; … Read More
  • What are the different tables present in mysql? Total 5 types of tables we can create 1. MyISAM 2. Heap 3. Merge 4. InnoDB 5. ISAM 6. BDB MyISAM is the default storage engine … Read More
  • php file_get_contents This function is the preferred way to read the contents of a file into a string. The function itself does nothing but puts the source of the web page you supply it into a string available for us… Read More
  • What is LAMP? LAMP means combination of Linux, Apache, MySQL and PHP. … Read More
  • Cookies Versus Sessions?  Cookies The setcookie( ) call needs to be before the HTML form because of the way the web works. HTTP operates by sending all "header" information before it sends "body" information. In the header, it sends t… Read More
  • php interview questions PHP Interview Questions and Answers Click  this  link   … Read More
  • How get the value of current session id? Session_id() returns the session id for the current session. … Read More
  • Cannot modify header information Check that <?php is at the very start of the functions.php file (before any whitespace) and remove ?> at the end of that file. header or setcookie or anything else that sends HTTP headers has  to be done before&n… Read More
  • Pagination in PHP and MySQL <?php function pagination($per_page = 10, $page = 1, $url = '', $total){ $adjacents = "2"; $page = ($page == 0 ? 1 : $page); $start = ($page - 1) * $per_page; $prev = $page - 1; $next = $page + 1; $lastpage = ceil… Read More
  • thumbnail creation PHP script   To create a thumbnail, first check file entenson, and then read in the file using the imagecreatefromjpeg() or imagecreatefrompng() or imagecreatefromgif() function and can calculate the new thumbnail size. imag… Read More
  • php exec The exec() function is one of several functions you can use to pass commands tothe shell. The exec() function requires a string representing the path to the commandyou want to run, and optionally accepts an array variable th… Read More
  • PHP Write and Read from File $fp = @fopen ("text1.txt", "r"); $fh = @fopen("text2.txt", 'a+'); if ($fp) { //for each line in file while(!feof($fp)) { //push lines into array $thisline = fgets($fp); $thisline1 = trim($thisline); … Read More
  • Use $_POST to get input values It will execute the whole file as PHP. The first time you open it,  $_POST['submit']  won't be set because the form has not been sent.    <?php if (isset($_POST['submit'])) { $example = $_POST['… Read More
  • mod_rewrite? Rewrites the requested URL on-the-fly based on configuration directives and rules. You are using system paths. Apache mod_rewrite only works with URLs,   RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} … Read More
  • PHP? PHP (Hyper text Pre Processor) is a scripting language commonly used for web applications … Read More