Question whether given array contains a given element

array:has_value?(ARRAY $array, $element, BOOL $strict_match=FALSE) : BOOL

array:has_value?([1,2],2) 
#=> TRUE

array:has_value?([1,2],3) 
#=> FALSE

# by default it does a non-strict match
array:has_value?([1,2],"2") 
#=> TRUE

# You can provide TRUE as the third argument to make the match strict
array:has_value?([1,2],"2", true) 
#=> FALSE

array:has_value?(["name" => "SunSed","version" => 4],"SunSed") 
#=> TRUE

array:has_value?(["name" => "SunSed","version" => 4],"sunsed") 
#=> FALSE

array:has_value?(["name" => "SunSed","version" => 4],"name") 
#=> FALSE

Copyright ©2013-2022 SunSed®. All rights reserved.