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
The simplest method I can think of is using a regular expression to math everything between [
and ]
then replace it with ""
. The code below will replace the string you used in the example. If the actual strings that need to be removed are more complex you can change the regular expression to match then. I recommend using regexpal.com for testing your regular expressions.
$string = preg_replace("\[[A-Za-z .]*\]","",$string);