-1
How to mount the following array if one of the variables is not defined?
$a = 1;
$b = 2;
$d = 4;
$array = array($a, $b, $c, $d);
The values of the variables ($a, $b, $c and $d) come from a server and often do not contain any value, so the array becomes inconsistent.
As a solution, I could use isset() to check if they exist and if they do not exist, assign any value. But, I cannot assign new values if they do not exist. How to proceed in the mount?
If one of them does not exist, it is returned, as in the example code where the $c variable is missing: Undefined variable: c
Cahe, thank you.
– user3486019
I’m sorry, I didn’t see that there was a double question...
– Cahe