Page 1 of 1

Check for a numerical character

Posted: Mon Jul 24, 2006 6:20 am
by tyrant1337
Hi,

Im trying to find out whether a value contains a numerical character in it

i.e. If FY1 1AL then ill do something with it or if its Bleakpool for instance I wont

The code ive found doesnt seem to work

Code: Select all

if(preg_match('[0-9]', $value))
Any comments would help

Cheers

Posted: Mon Jul 24, 2006 6:40 am
by Benjamin
Try

Code: Select all

if (preg_match('#[0-9]#', $value))