Good day!
I would like some help in removing strings inside the square brackets and including the square brackets.
The string looks like this:
$str
$str = "Lorem ipsum dolor
[ Context are found on www.example.com ]
some text here. Text here. [test] Lorem ipsum dolor.";
$str = preg_replace('~\[[^]]*?www\.example\.com[^]]*\]~si', "", $str);
var_dump($str);
string(83) "Lorem ipsum dolor
some text here. Text here. [test] Lorem ipsum dolor."
PS: It will work with line broken in multiple lines.