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  Python code snippet - How to drag a box on your screen ?

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.