note 84077 deleted from function.session-name by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:43:03 +0000 |
| Subject: | note 84077 deleted from function.session-name by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196611@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at nncoders dot de
----
You can always just use "or".
@foo or bar();
When foo fails, (and the at still means don't print an error to the browser), the function bar
will be executed.
<?php
function errorhandler () { /* do something wild */ }
@session_name('mysession') or errorhandler();
?>
Another live example would be
@mysql_query('show databases') or die(mysql_error());
When the execution fails, parameter die is called (with last mysql_error as given string parameter)