i am just getting stuck with php regular expression to filter data. I want to detect 'Results 1 - 20 of 60' using regular expression and then delete the data from $content
$content="We have Results 1 - 20 of 60 some blah blah blah";
$content = preg_replace("/regular-expression/", " ", $content);
Here expected output is: We have some blah blah blah
Any Idea?
Shortly, here is a solution
$content="We have Results 1 - 20 of 60 some blah blah blah";
$content = preg_replace("/(Results)(\\s+)(\\d+)(\\s+)(-)(\\s+)(\\d+)(\\s+)(of)(\\s+)(\\d+)/", " ", $content);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With