if($hOne!='') {
echo 'yes';
} else {
echo 'no';
}
SO for a while i have been using the above code to determine id X variable has been set, now this was working ok until working on a wordpress site (i wont go into too much details) but basically initially the varabile has never been touched and works as intended, if you enter a value and then delete that value it seems to think its been set.
a way i got round this is to use the below code, my question is, is there a better way to do this.
Cheers
if (preg_match('/[A-Za-z]/i', $hone)) {
echo 'yes';
} else {
echo 'no';
}
Result Used the below which works as intended, thank you all:
if(isset($hone) and
!empty($hone)) {
echo '1';
} else {
echo '2';
}