I would like to extract the last 4 words from a string as a single chunk.
For example, if I have:
"Are You Looking For The Best Website Review"
I'd like to catch the last four words as:
"The Best Website Review"
I only have basic coding knowledge and have tried every variation I could find within this forum.
The closest I've come is by using the suggestion of Rick Kuipers (How to obtain the last word of a string) but this gives me the words as individual values.
$split = explode(" ", $str);
echo $split[count($split)-4];
echo $split[count($split)-3];
echo $split[count($split)-2];
echo $split[count($split)-1];
My coding knowledge is limited so any suggestions would be appreciated.