Gen. partnerAlgotech

PHP function in_array()

Checks if the element is part of an array.

|
September 11, 2019

Availability in PHP 4.0

Checks if the element is part of an array.

Parameters

Parameter Data type Default value Note
$needle mixed not Search value
$haystack array not Searched array
$strict bool false Should the data type be checked as well? It behaves the same as == and === in the condition.

Return values

bool

Returns true if the element is contained in the array, otherwise false.

Other resources

Official in-array documentation

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.