Remove numbers from a string in PHP.

A quick way to remove numbers from a string in PHP,

$string = "This is my string, I also have 3823 9283";
$clean_string = str_replace(range(0,9),'',$string);

// This will return "This is my string, I also have"
echo $clean_string;

Leave a Reply