note 125279 added to function.key-exists
| From: | mahmoudaburascea at gmail dot com | Date: | Tue, 18 Aug 2020 08:23:38 +0000 |
| Subject: | note 125279 added to function.key-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214982@lists.php.net to get a copy of this message | ||
key_exists() is an alias of array_key_exists() so you use it in the exact same way:
Example:
$test_array = [1, 7, 0, 2, 2, 0, 1, 1];
$test_1 = key_exists(4, $test_array);
$test_2 = array_key_exists(4, $test_array);
$test_3 = key_exists(2, $test_array);
$test_4 = array_key_exists(2, $test_array);
echo($test_1, $test_2, $test_3 $test_4);
Result:
false false true true
Pretty self-explanatory :)
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.166.36 (proxied: 164.160.144.2)
----
Manual Page -- http://php.net/manual/en/function.key-exists.php
Edit -- https://master.php.net/note/edit/125279
Del: integrated -- https://master.php.net/note/delete/125279/integrated
Del: useless -- https://master.php.net/note/delete/125279/useless
Del: bad code -- https://master.php.net/note/delete/125279/bad+code
Del: spam -- https://master.php.net/note/delete/125279/spam
Del: non-english -- https://master.php.net/note/delete/125279/non-english
Del: in docs -- https://master.php.net/note/delete/125279/in+docs
Del: other reasons-- https://master.php.net/note/delete/125279
Reject -- https://master.php.net/note/reject/125279
Search -- https://master.php.net/manage/user-notes.php