Im using PHP preg_match_all function and I need it to return an array of every single word AND every pair of words, including those single words, for example:
preg_match_all('/the regex/','Stackoverflow is awesome',$matches);
The $matches array should contain:
('Stackoverflow' , 'is' , 'awesome' , 'Stackoverflow is' , 'is awesome')
I've tried with this regex but not getting the expected results:
[a-z]+\s?[a-z]*