How to remove all numbers from a string in PHP

1 Answer

0 votes
$s = "123abc798";
$s = preg_replace('/[0-9]+/', '', $s);
   
echo $s;

/*
run: 

abc 

*/

 



answered Apr 21, 2016 by avibootz
...