Using a string that does not match a variable, and an array of variable names:


SUBMITTED BY: henry1874w

DATE: June 26, 2017, 5:09 p.m.

FORMAT: Text only

SIZE: 180 Bytes

HITS: 212

  1. <?php
  2. $firstname = "Peter";
  3. $lastname = "Griffin";
  4. $age = "41";
  5. $name = array("firstname", "lastname");
  6. $result = compact($name, "location", "age");
  7. print_r($result);
  8. ?>

comments powered by Disqus