Fill an array with values, specifying keys:


SUBMITTED BY: henry1874w

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

FORMAT: Text only

SIZE: 91 Bytes

HITS: 265

  1. <?php
  2. $keys=array("a","b","c","d");
  3. $a1=array_fill_keys($keys,"blue");
  4. print_r($a1);
  5. ?>

comments powered by Disqus