I
I
Ilyusha Prokopiev2017-03-16 14:22:08
PHP
Ilyusha Prokopiev, 2017-03-16 14:22:08

Why does the array_search function fail?

There is an array like $alphabet = array('а', 'б', 'в', 'г', 'д').
I want to get the element key array_search('а', $alphabet)
Why does this code return an error?

<b>Warning</b>:  array_search() [<a href='function.array-search'>function.array-search</a>]: Wrong datatype for second argument in...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Svirsky, 2017-03-17
@e_svirsky

stackoverflow.com/questions/11708203/array-search-...

H
he he, 2017-03-16
@tosha_lol_daaa

I can assume that indices are needed (0 => 'a', 1 => 'b')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question