Josh
0
Q:

in_array

<?php
  $os = array("Mac", "NT", "Irix", "Linux");
  if (in_array("Irix", $os)) {
      echo "Got Irix";
  }
  if (in_array("mac", $os)) {
      echo "Got mac";
  }
?>
1

<?php

$people = array("Peter", "Joe", "Glenn", "Cleveland");



if (in_array("Glenn", $people))

  {

  echo "Match found";

  }

else

  {

  echo "Match not found";

  }

?>
 
3
<?php
/**
in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool
*/

$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
    echo "Got Irix";
}
if (in_array("mac", $os)) {
    echo "Got mac";
}
?>

3

<?
in_array("Irix", $os);
?>

2
in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool
2

in_array(search, array, type)
0

Related

New to Communities?

Join the community