C
C
codemania2018-03-15 18:27:44
PHP
codemania, 2018-03-15 18:27:44

Is it possible to find out in which element this value is?

I have a PHP array

array(3) {
  [0]=>
  array(13) {
    ["var"]=>
    string(2) "22"
  [1]=>
  array(13) {
    ["var"]=>
    string(2) "33"
  [2]=>
  array(13) {
    ["var"]=>
    string(2) "44"

There is a number, for example 44, you need to find out in which nested array it is located (in this example 2). It is impossible to swap keys and values, because in each index of the array, in addition to the var element, there is still a bunch of everything and sometimes there are more stacked arrays.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zorca, 2018-03-15
@codemania

array_search

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question