I am trying to replace a string with preg_replace()
I want to replace only one pattern 'bbb' but I want to match that pattern and two more ('aaa' and 'ccc') exactly like for example
input : 'zzz aaa bbb ccc xxx'
pattern to match : 'aaa bbb ccc'
output : 'aaa ccc'
Is it possible to make it happen with just preg_replace() without invoking preg_match()
You can use: