Reputation: 827
<some string>[]<somestring>
example
variable[]_abc
How can I get everything except []
from the string using preg_
in php?
Upvotes: 0
Views: 28
Reputation: 23880
If you only want to remove []
use str_replace.
$newstring = str_replace('[]', '' $string);
There is no need for a regex to remove static characters.
Upvotes: 1