I'm new using PHP, and I'm trying to store functions in an array to call them later using an if statement.
I've tried but, functions are called before if statement, so this is an example of what I need:
function a() {
return 'a';
}
function b() {
return 'b';
}
$array = [a(), b()];
if($condition === 'a') {
$array[0];
}
What I want to achieve is to use a specific function depending on if validation.