Gen. partnerAlgotech

PHP funkce array_search()

Searches the array for a given value and returns the corresponding key if successful

|
11. září 2019

Dostupnost ve verzích: PHP 4.0.5

Searches the array for a given value and returns the corresponding key if successful

Parametry

Parametr Datový typ Výchozí hodnota Poznámka
$needle mixed není The searched value.
$haystack array není The array.
$strict bool null If the third parameter strict is set to true then the array_search function will also check the types of the needle in the haystack.

mixed

the key for needle if it is found in the array, false otherwise.

If needle is found in haystack more than once, the first matching key is returned. To return the keys for all matching values, use array_keys with the optional search_value parameter instead.

Další zdroje

Oficiální dokumentace funkce array-search

Načítání komentářů...

Zůstaňte v obraze

Přihlaste se k odběru našeho newsletteru a získejte nejnovější informace o kybernetické bezpečnosti přímo do vaší e-mailové schránky.

Vaše údaje jsou v bezpečí. Newsletter můžete kdykoliv odhlásit.