I have a very simple task yet it keeps failing.
I want to have a function inside a class and the param that you pass into the function will be an array. All the function has to do is echo back the contents of the array.
Echoing out all the variables in for example the $_POST array is very easy to achieve with a foreach loop. However, it does not work in my class.
This was a very generic explanation. I you need more details please ask.
public function check_if_filled($array){
foreach($array as $key->$value){
echo $key . " : " . $value;
}
}
any advice why it gives me this error
Notice: Undefined variable: value in (my page) on line 117
Fatal error: Cannot access empty property in (my page) on line 117