fork(1) download
  1. <?php
  2.  
  3. $s = "e8v5i0l9ny3hw1f24z7q6";
  4. $s = preg_replace('/[^\d]/i', '', $s); //remove non digits
  5. if(strlen($s) == 10) //do we have 10 digits ?
  6. if (!preg_match('/(\d)(\1+)/i', $s)) //if no repeated digits
  7. echo "String has 10 different digits";
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
String has 10 different digits