string processing question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Given a string: 'aaa bbbb cccc'
or a string:    'aaaa bbb cc'

I want to find and delete any word within a string with 3 or less chars.
so I would get:
'bbbb cccc'
as results after processing.

How would I do this in PHP?


Re: string processing question

Quoted text here. Click to load it

preg_replace('/\b\S\b\s*/', '', $text) should do it.

Site Timeline