Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Mar 182011

Error control operator in PHP


The error control operator (the @) is useful to ignore any error messages that might be generated by PHP.



$my_value = @$my_array[$key];

The above statement will not generate any warning even if the index $key doesn't exist.

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>