How can I read the contents of array
$detail[3]
after using explode(implode)
?
I'm doing the following:
$aArray = array(
"Titulo" => array(
"Class|SubTitulo" => Array(
"Detalhe01",
"Detalhe02",
"Detalhe03",
"Atividades" => Array(
"Atividade01;",
"Atividade02;",
"Atividade03;"
)
)
)
);
foreach ($aArray as $title => $aInfo) {
echo "Titulo: ".$title ."<br>";
foreach ($aInfo as $subTitle => $aDetail) {
$subTitle = explode("|", $subTitle);
echo "-- Class: ".$subTitle[0] ."<br>";
echo "-- SubTitulo: ".$subTitle[0] ."<br>";
$detail = explode("|", implode("|", $aDetail));
echo "----- Detalhe: " . $detail[0] ."<br>";
echo "----- Detalhe: " . $detail[1] ."<br>";
echo "----- Detalhe: " . $detail[2] ."<br>";
foreach ($detail[3] as $activity => $value) { // O Erro da nesta linha
echo "-- Atividade: ".$activity."<br>";
echo "----- Valor: ".$value."<br>";
}
}
}
But it is giving invalid argument error
Warning: Invalid argument supplied for foreach ()