Search for the value "Glenn" in an array and output some text:


SUBMITTED BY: henry1874w

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

FORMAT: Text only

SIZE: 176 Bytes

HITS: 853

  1. <?php
  2. $people = array("Peter", "Joe", "Glenn", "Cleveland");
  3. if (in_array("Glenn", $people))
  4. {
  5. echo "Match found";
  6. }
  7. else
  8. {
  9. echo "Match not found";
  10. }
  11. ?>

comments powered by Disqus