Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //check that the string starts with a digit, and contains only alphanumeric characters.
- $pattern = '/^[0-9][0-9A-Za-z]*/';
- $str1 = '5fun4all';
- $str2 = 'fun4all5';
- if (preg_match($pattern, $subject)) {
- //more about preg_functions coming up
- }
- //The pattern matches '5fun4all' but not 'fun4all5'
Add Comment
Please, Sign In to add comment