Page 1 of 1

foreach 2 ชั้น

Posted: 03/09/2014 9:59 am
by offing

Code: Select all

<?php

$colour = array("gloss" => array(
"red","yellow","orange"),
"poster" => array("pink","blown","black"),
"pastel" => array("gley","white")
);

foreach($colour AS $type => $col){
echo $type."</br>";
	foreach($col AS $value ){
	echo "<li>".$value."</br>";
	
	}

}

?>
arraycolour.jpg
arraycolour.jpg (11.72 KiB) Viewed 561 times