PHP » PYTHON |
login |
register |
about
|
PYTHON array_key_exists
is this article helpful?
|
Python replacement for PHP's array_key_exists
[
edit
| history
]
key in myDict # Python 2.2+ array_key_exists(PHP 4 >= 4.0.7, PHP 5) array_key_exists — Checks if the given key or index exists in the array Descriptionarray_key_exists() returns TRUE if the given key is set in the array. key can be any value possible for an array index. Parameters
Return ValuesReturns TRUE on success or FALSE on failure. Changelog
Examples
Example #1 array_key_exists() example
<?php
Example #2 array_key_exists() vs isset() isset() does not return TRUE for array keys that correspond to a NULL value, while array_key_exists() does.
<?php See Also
|
more
Recently updated
more
Most requested
more
Last requests
|