I'm making a script that shows errors at installer with an array, so whenever there is an error the PHP array will handle the error name
Like this :
$errors = array();
// knowing that it's not always the same array value count, it could be 0 or 5 or even 10
$errors[]= "error 1";
$errors[]="error 2";
$errors[]="error 3";
Then the hard part is when i'm trying to print this using a function and not a Foreach loop
So How can i make all these array values as an argument for function then print it ?
I think this is a start
function show_error() {
$args = func_get_args();
$message = //here foreach all the errors as a message the display it
echo '<!DOCTYPE html>
<html>
<body>
<div class="error-message">'.$message.'</div>
</body>
</html>';
exit;
}