Check if the integer key "0" exists in an array:


SUBMITTED BY: henry1874w

DATE: June 23, 2017, 9:38 p.m.

FORMAT: Text only

SIZE: 144 Bytes

HITS: 340

  1. <?php
  2. $a=array("Volvo","BMW");
  3. if (array_key_exists(0,$a))
  4. {
  5. echo "Key exists!";
  6. }
  7. else
  8. {
  9. echo "Key does not exist!";
  10. }
  11. ?>

comments powered by Disqus