Here is my code:
$tags_specified_pattern = "/\[(.+?)\]/";
preg_match_all($tags_specified_pattern, $q, $matches);
if ( count($matches[1]) ){
I need to remove all matched parts form $q
}
Here is an example:
$q = "This is [tag1] tag1 and this is [tag2] tag2";
And this is the expected result:
This is tag1 and this is tag2
Any idea how can I do that?