I'm trying to check if a variable is existing, and if not - then define it.
$checkarray = array($demo1, $demo2, $demo3);
foreach ($checkarray as $checkkey) {
if (!isset($checkkey)) {
$checkkey = 'none';
}
}
But I'm just getting this error: *Notice: Undefined variable: demo1 (and so on...)
This is bascially what i'm trying to achive...
if (!isset($demo1)) {
$demo1 = 'none';
}
if (!isset($demo2)) {
$demo2 = 'none';
}
if (!isset($demo3)) {
$demo3 = 'none';
}
But it's not pretty.
Any ideas?
Cheers Kris