I have a function that tries to grab some emails using the imap library. If it can't connect I would like the function to just return without doing anything else.
$imap = imap_open($mailboxPath, $username, $password);
if (!$imap)
return 0;
This works but I still get a PHP warning message that the connection attempt has failed from a timeout. Can I prevent this warning from being displayed?