fork(1) download
  1. <?php
  2.  
  3. $re = "/^[0-9]{7,10}$/";
  4. $str = "0921234567";
  5. if (preg_match($re, $str, $match)) {
  6. echo "+385." . preg_replace('/^0+/', '', $match[0]);
  7. }
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
+385.921234567