--- date: 2017-07-29T18:56:36+01:00 description: "Function bash array_key_exists(), equivalent to PHP" draft: false include_toc: true show_comments: false tags: ["Bash", "array"] title: "Bash: function array_key_exists()" translationKey: "bash-array-key-exists" --- ## Description `array_key_exists()`: check if key exists into array! *Equivalent to the PHP Function [PHP array_key_exists](http://php.net/manual/en/function.array-key-exists.php)()* ## Source Code {{< code "dev-bash-array-key-exists-src" bash >}} ### Parameters * `key` is the searched key * `haystack` is the array where to search ### Return Values * Returns `0` if the `key` found into `haystack`; considere this value as `TRUE` * Otherwise, returns `1`: considere this value as `FALSE` ## Example {{< code "dev-bash-array-key-exists-example" bash >}} ------------------------------------------------------------------------