Skip to content

PHP code snippet – How to remove words in contain integer ?

$input = "H3llo This is a? #test e3ample of a sentence-word bl&h.";
echo preg_replace('/(?=[^ ]*[^A-Za-z \'-])([^ ]*)(?:\\s+|$)/', '', $input);

This is of a sentence-word
See also  How to make a programming language with Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.