Search an array for the value "red" and return its key:


SUBMITTED BY: henry1874w

DATE: June 25, 2017, 2:48 p.m.

FORMAT: Text only

SIZE: 87 Bytes

HITS: 292

  1. <?php
  2. $a=array("a"=>"red","b"=>"green","c"=>"blue");
  3. echo array_search("red",$a);
  4. ?>

comments powered by Disqus