Menu
Hi,
I am trying to use the code below to only allow through numeric or a + sign or whitespace.
So it would let through this +0989 and 9879
but would not let through +989jkhj or kjhkj9089
I have this, now i know ctype_punt isn’t right but im not sure
[code=php]
$val = ‘9890 +’;
if (!ctype_digit(trim($val)) && !ctype_punct(trim($val))) {
echo ‘No’;
} else {
echo ‘Yes’;
}
Thanks
k0r54