$grades = array( "ali"=>array("php","50"), "sami"=>array("php","77"), "rami"=>array("php" ) );
foreach ($grades as $ar_element) { echo $ar_element; foreach($grades as $index => $value) { echo " Name: ".$index." , "; } }
Quote:Warning: Array to string conversion in /tmp/kF1L1NVkwY.php on line 12 Array Name: ali , Name: sami , Name: rami , Warning: Array to string conversion in /tmp/kF1L1NVkwY.php on line 12 Array Name: ali , Name: sami , Name: rami , Warning: Array to string conversion in /tmp/kF1L1NVkwY.php on line 12 Array Name: ali , Name: sami , Name: rami ,
foreach($grades as $index => $value) { echo " Name: ".$index." , value: "; print_r($value); }
foreach($grades as $index => $value) { echo " Name: ".$index." , values: "; foreach($value as $elt) echo $elt.", "; echo "\n"; }
foreach ($grades as $ar_element) { echo $ar_element; foreach($ar_elementas $index => $value) { echo " Name: ".$index." , "; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)