0

hi i want to echo multidimansional array by using for each loop...
i m doing it but i m not able to do...
i hope some onwe will help me..

my code is

$Families = array ( "Farhad" =>array("Ali","Haider","Kashan"), "Sufyan" => array("Shahbaz","Ali2","Azaan"));

foreach($Families as $key2=>$values3)
{
	echo "$key2 $values3";
}

how to print all the values?
Regards..

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by Farhad.idrees
1

Add a loop:

$Families = array ( "Farhad" =>array("Ali","Haider","Kashan"), "Sufyan" => array("Shahbaz","Ali2","Azaan"));
 
foreach($Families as $key2=>$values3)
{
        foreach($values3 as $v)
        {
            echo "$key2 $v";
        {
}

bye :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.