I need to remove
[0037][user name]
combination from a sentence. In the first brackets always containing numbers eg:
[0032]
Digit count will not exceed than 4 by any chance. In the second brackets always containing letters eg:
[first name]
anyone have an idea how to do this?
You can use preg_replace()
to implement regular expression syntax and try the following expression.
$str = preg_replace('/\[\d+]\[[a-z ]+]/i', '', $str);