To avoid use for and foreach in the same time, i am looking for a good trick to manipulate foreach to get the result i want to.
I have this code:
foreach($array['database']['tables'][0] as $key => $value) {
echo $value . ' - ' . $key ."
";
}
I won't use FOR
here: $array['database']['tables'][ HERE ]
Are there any trick to avoid using FOR
on the foreach?
What about simple:
foreach ($array['database']['tables'] as $table) {
foreach ($table as $key => $value) {
echo $value . ' - ' . $key ."
";
}
}