note 31525 added to function.array-key-exists
| From: | drm at rack1 dot php dot net | Date: | Fri, 25 Apr 2003 00:06:53 +0000 |
| Subject: | note 31525 added to function.array-key-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47051@lists.php.net to get a copy of this message | ||
for the note above:
if functions do not exist in elder PHP versions, you might rather use the function
'function_exists()' to create a transparent equivalent:
if ( ! function_exists ( 'array_key_exists' ) ) {
function array_key_exists () {
// etcetera
}
}
the same applies for all kinds of functions like 'file_contents', 'is_a', etc...
useful functions which are implemented only in later versions. To be back- and forward compatible
i'd like to suggest you use constructions like this, and keep your code portable and
transparent :)
--
http://www.php.net/manual/en/function.array-key-exists.php
http://master.php.net/manage/user-notes.php?action=edit+31525
http://master.php.net/manage/user-notes.php?action=delete+31525
http://master.php.net/manage/user-notes.php?action=reject+31525