SHARE
TWEET

Untitled

a guest Jan 15th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //check that the string starts with a digit, and contains only alphanumeric characters.
  2. $pattern = '/^[0-9][0-9A-Za-z]*/';
  3. $str1 = '5fun4all';
  4. $str2 = 'fun4all5';
  5. if (preg_match($pattern, $subject)) {
  6.     //more about preg_functions coming up
  7. }
  8.  
  9. //The pattern matches '5fun4all' but not 'fun4all5'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top