Flip all keys with their associated values in an array:


SUBMITTED BY: henry1874w

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

FORMAT: Text only

SIZE: 117 Bytes

HITS: 232

  1. <?php
  2. $a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");
  3. $result=array_flip($a1);
  4. print_r($result);
  5. ?>

comments powered by Disqus