I have looked around but couldn’t find an appropiate solution.
I have this string
$area = array("Some Text area 1", "Some Text area 2", "Some Text area 33", "Some Text area 40")
I want to construct a preg_replace that would remove the word “area” and the 1 or 2 digit number that follows.
I can do this to remove “area 1”
$area = preg_replace('/area 1/','', $area);
I can keep repeating this to remove other matches but it’s not very efficiant.
Can I remove the pattern with just one preg_replace?
Thanks in advance
Will remove all matches which have the text ‘area’ followed by a number.