Traverse a multidimensional vector and capture existing value

Asked

Viewed 29 times

0

How to go through these vectors "$_SESSION['gatos1']" and when he finds a value equal to "$idt" it returned me the values contained within the vector that contains the value equal to the "$idt".

function buscar($idt){

    for($i = 1; $i < count($_SESSION['gatos2']); $i++){
        for($s = 0; $s < count($_SESSION['gatos1'][$i]); $s++){

            }
  • Ever tried to use with foreach?

  • Yes, yes, but once I use it does not deliver all the data that has in the vector where it has the value that is equal to "$idt".

  • 1

    But how is this vector? It would be good if you showed an example of it.

  • From a print_r (json_Encode ($_SESSION)) and put the answer here is easier to help.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.