note 21361 added to function.function-exists
| From: | cluebie@php.net | Date: | Thu, 09 May 2002 20:44:46 +0000 |
| Subject: | note 21361 added to function.function-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30401@lists.php.net to get a copy of this message | ||
If you know a function exists but want to see if it is available you should execute it and compare
it's return value to false.
eg: The getmxrr() function on a Windows platform exists but is not available (as of 4.2.0). To
check:
$result = @getmxrr("me@hotmail.com");
if ( false === $result ) {
# do unavailable function handling
}
The @ silences the unavailable function warning.
--
http://www.php.net/manual/en/function.function-exists.php
http://master.php.net/manage/user-notes.php?action=edit+21361
http://master.php.net/manage/user-notes.php?action=delete+21361
http://master.php.net/manage/user-notes.php?action=reject+21361