fork(1) download
  1. <?php
  2.  
  3. $str = "a1234";
  4.  
  5. if (preg_match('/^\d/', $str)) {
  6. if (mb_strlen(preg_replace('/\D/', '', $str), 'UTF8') < 4 ||
  7. mb_strlen(preg_replace('/[\P{L}\P{M}]/u', '', $str), 'UTF8') < 2) {
  8. echo "Invalid";
  9. }
  10. else
  11. {
  12. echo "Valid";
  13. }
  14. }
  15.  
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
Standard output is empty