PHP

In Array

<?php
   $needle = "Sam";
   $haystack = array("Johnny", "Timmy", "Bobby", "Sam", "Tammy", "Danny", "Joe");
   if (in_array($needle, $haystack)) {
      print "$needle is in the array!\n";
   } else {
      print "$needle is not in the array\n";
   }
?>

José M. Vidal .

18 of 33