arrays - PHP Lost value of foreach after if -


i lost value in foreach after if

foreach ($etc_uloziste  $id => $etc_id) {     foreach ($etc_id  $id2 => $etc_id2) {         if($rodic1==$id) {             if( ! in_array( $etc_id2, $etc_mn) ) {                  //check if season displayed                  $sql.= ",\n"." ".$etc_id2."_id"." int";                  $etc_mn[] = $etc_id2; //store season in array             }         }     } } 

before if have value like:

[book] => array         (             [0] => library             [1] => room         ) 

but after if have

[book] => array         (             [0] => library         ) 

the $etc_id2 library or room , $id book

i lost value in 2. echo

 foreach ($result2  $rodic1 => $rodic_hodnot1)             {                         foreach ($etc_uloziste  $id => $etc_id)                     {                                                                foreach ($etc_id  $id2 => $etc_id2)                                      {                                                                           //echo $etc_id2."\n";                                                                         if($rodic1 ==$id)                                            {                                              //echo $etc_id2."\n";                                                                                           }                                                                    }                                                                                                                                                                                        }             } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -