How can I do a reg ex on a date to remove it from a string?
"Posted 6 September 2016"
I want to remove this. but the date varies.
Depending on all the circumstances, there might be better options, but if we go with regex for now, the simplest might be:
$text = preg_replace('/\bposted \d{1,2} [a-z]{3,} \d{4}\b/i', '', $text);