Whilst developing a php class i have run into a rather interesting thing within php. If i was to create a array, some single keys and some with arrays within that key, it only echos numbers rather than the arrays key. Why is that and how do i fix it?
<?php
$example = array('name' => array('required' => true), 'email');
foreach($example as $field => $value) {
echo $field;
}
?>
This returns name0 rather than nameemail
you probably want this ::