Array ( [room] => Array ( [0] => library ) [book] => Array ( [0] => library [1] => room ) [author] => Array ( [0] => book ) [title] => Array ( [0] => book ) [genre] => Array ( [0] => book ) [price] => Array ( [0] => book ) [publish_date] => Array ( [0] => book ) [description] => Array ( [0] => book ) ) //and this is the way i get the value i add it after the foreach from forum if (!empty($rodic_hodnot1['etc'])) { foreach ($rodic_hodnot1['etc'] as $etc_hodnot1) { $etc_uloziste[$etc_hodnot1][]=$rodic_hodnot1['node'] ; //print_r ($etc_uloziste."/n"); } //print_r ($etc_uloziste); }