I have index.php, and function.php.
In index.php i have included function.php
In index.php im calling login("Bla","123"); which exists in function.php
In index.php I have a if (!empty($err)){ foreach(..) echo $err ... }
login() should return a array called $err, (with return $err; ) if there is any errors, and then it should echo it out in the foreach in index.php..
But somehow I can not get it to work. Can't you do it like this? Im not getting anything back.
I have in the login() :
$err = array();
$err[] = "Something went wrong";
return $err;
exit();
What's wrong here? Or any other solution to do this?
exit()afterreturn? Can you show us the wholeloginfunction?