Function __global->in_array

Definitions

sources_custom/phpstub.php

  • Checks if a value exists in an array.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$needle mixed No No required parameter N/A N/A Needle
$haystack array No No required parameter N/A N/A Haystack
$strict boolean No No False N/A N/A Use strict type checking

Returns

  • Whether the value exists in the array
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Checks if a value exists in an array.
 *
 * @param  mixed $needle Needle
 * @param  array $haystack Haystack
 * @param  boolean $strict Use strict type checking
 * @return boolean Whether the value exists in the array
 */

function in_array($needle, array $haystack, bool $strict = false) : bool