I'm working on a simple login & register system as practice and I want to check strings if they contain a number and at te same time with preg_match, but how can I make that happen?
if (preg_match('~[0-9]~', $name)) { echo "match";}
If you want to find white spaces you have to use \s in the regular expression.
preg_match('~[0-9\s]~', $name)