Home >> PHP >> array_key_exits() function in PHP

array_key_exits() function in PHP

The array_key_exits() function used for checks if the key exists in the array.

Syntax

array_key_exists(key,array)

Example

$array = array('a' => 1, 'b' => 2);
if (array_key_exists('a', $array)) {
    echo "The a element is in the array";
}

Output

The a element is in the array

Post Your Comment

Next Questions
array_keys() function
array_map() function
array_merge() function
array_merge_recursive() function
array_multisort() function
array_pad() function
array_pop() function
array_product() function
array_push() function
array_rand() function
array_reduce() function
array_reverse() function
array_search() function
array_shift() function
array_slice() function
array_splice() function
array_sum() function
array_udiff() function
array_udiff_assoc() function
array_udiff_uassoc() function
array_uintersect() function
array_uintersect_assoc() function
array_uintersect_uassoc() function
array_unique() function
array_unshift() function

Copyright ©2022 coderraj.com. All Rights Reserved.