I am making a web application, I am trying to use a foreach loop and I have run into some problems.
Example
$arr = array(
'username' => 'Test',
'password' => 'Cheese',
);
foreach($arr as $arr2){
echo $arr2['username'];
}
That will output this:
Warning: Illegal string offset 'username' in PATH on line 8 T
Warning: Illegal string offset 'username' in PATH on line 8 C
Does anyone know how to fix this issue.