1$var_num = "1";
2$var_str = "Hello World";
3
4var_dump( is_numeric($var_num), is_numeric($var_str) );
5
6/*
7Output -
8 bool(true)
9 bool(false)
10*/
1if (preg_match('/[A-Za-z]/', $myString) && preg_match('/[0-9]/', $myString))
2{
3 echo 'Contains at least one letter and one number';
4}