How do I Store an Array Variable Inside of Another Array Variable using while loop and for each?
-
Please go read How to Ask.C3roe– C3roe2017-06-08 09:27:45 +00:00Commented Jun 8, 2017 at 9:27
-
Your question is confusing. If you want to print an array you can use print_r($array). Please be clear with your questionteshvenk– teshvenk2017-06-08 09:29:36 +00:00Commented Jun 8, 2017 at 9:29
-
I want to print array like in image which i have upload in questionJigu– Jigu2017-06-08 09:31:20 +00:00Commented Jun 8, 2017 at 9:31
-
i.sstatic.net/fu2nn.jpg This is the outputJigu– Jigu2017-06-08 09:31:51 +00:00Commented Jun 8, 2017 at 9:31
Add a comment
|
2 Answers
please chec Foreach for arrays inside of an array
foreach($resultArray as $row => $innerArray){
foreach($innerArray as $innerRow => $value){
echo $value . "<br/>";
}
}
also check this link : Foreach for arrays inside of an array
Comments
You are probably looking for
<?php
$format = array('Roman' => array('one'=>'I','two'=>'II'),
'Arbic' => array('one'=>'1','two'=>'2'));
while (list($key, $value) = each($format)) {
echo $value;
foreach( $key as $key1 => $value1) {
echo $key1 .'='.$value1;
}
?>
I have not tested .
1 Comment
Suraj Khanra
I have shared this answer to print your array using while and foreach loop