Assign variables as if they were an array:


SUBMITTED BY: henry1874w

DATE: June 27, 2017, 5:05 p.m.

FORMAT: Text only

SIZE: 137 Bytes

HITS: 258

  1. <?php
  2. $my_array = array("Dog","Cat","Horse");
  3. list($a, $b, $c) = $my_array;
  4. echo "I have several animals, a $a, a $b and a $c.";
  5. ?>

comments powered by Disqus