In PHP how to I return the value 1, 2 and 3 in the array bellow?
$tmpArray =
array(
array("one", array(1, 2, 3)),
array("two", array(4, 5, 6)),
array("three", array(7, 8, 9)
)
);
$tmpArray[0][1] = array(1, 2, 3)
$tmpArray[0][1][0] = 1
$tmpArray[0][1][1] = 2
$tmpArray[0][1][2] = 3
Try like this
foreach($tmpArray as $key => $value)
{
foreach($value as $val)
echo $val.'<br>';
}
try this-
foreach($tmpArray as $key => $value)
{
if(is_array($value)){
foreach($value as $val)
if(is_array($val){
foreach($val as $v)
echo $v."<br />";
}
else
echo $val.'<br />';
}
else
echo $value."<br />";
}