Posted On: Feb 22, 2018
PHP array_key_exists() Function is used to check a key exist or not in an array.
Example Uses
<?php $a=array("fruit"=>"Apple","Car"=>"BMW"); if (array_key_exists("Apple",$a)) { echo "Array Key exists!"; } else { echo "Array Key does not exist!"; } ?>
Never Miss an Articles from us.
PHP Array is a special type of variable that stores multiple values in a single variable. There are 3 types of array available in PHP they areIndexed arrays Associative arrays Multidimensional a...
It is very easy to create an array in PHP. You can create an array in PHP using array() function or simply assigning [] in front of variable. $array1=array() or $array1=[];...
You can use count() function to count the number of elements in a PHP Array. $array=['ram','ravi','ajay','vijay']; echo count($array); // outputs 4 ...