The variable $value
is not an array but a string. That's the reason why the error message is being displayed.
Without seeing the code there's not much to suggest. But in general, this is how foreach loops work:
Say your array structure is as follows.
Array
(
[name] => Tom
[gender] => Male
[age] => 18
)
To display all the elements, i.e. 'Tom', 'Male', '18', you'd do something like this:
foreach ($array as $key => $value) {
echo $arr[$key].'<br>';
}
Output:
Tom
Male
18
To retrieve only a particular value:
For example, if you want to retrieve the person's name, you can do:
echo $arr['name']; //Tom
echo $arr['gender']; //Male
echo $arr['age']; //18
Hope this clears up things for you! :)