vendredi 2 mai 2014

PHP Regex Replace digits after first two any characters


Vote count:

0




I need help in fixing a string, i need to remove DIGITS from a string using "preg_replace" after the first two any characters of the string, examples can be:



  1. N02 [ Should remove 2 ]

  2. AX1001 [ Should remove 1001 ]

  3. AR2003 [ Should remove 2003 ]

  4. AR [ out put should be AR, because there are no digits ]


Currently am using: preg_replace( '/\d/', '', "A0123" );


But it removes digits from the start. Any one can help?


Regards



asked 51 secs ago






Aucun commentaire:

Enregistrer un commentaire