Lets say I have a word like this
"I shoot someone using ak47 and m4s 32 times"
"I shoot someone using ak47 and m4s times"
You could do that with a regex checking for word boundaries and digits:
Here you are checking for a word-boundary, followed by any number of digits followed by another word boundary. The forward slashes are the delimiters.
Then you can use for example
preg_replace to replaced the matched numbers with an empty string:
$result = preg_replace('/\b\d+\b/', '', $your_string);
Note that you will end up with 2 spaces between
times but you will not see that in html output. If necessary, you can search for these as well.