php check if string contains number

Solutions on MaxInterview for php check if string contains number by the best coders in the world

showing results for - "php check if string contains number"
Aidan
05 Sep 2020
1if (preg_match('/[A-Za-z]/', $myString) && preg_match('/[0-9]/', $myString))
2{
3    echo 'Contains at least one letter and one number';
4}