how do i explode the square brackets and then replace them with some text?
i tried the following code, but it seems only recognize the first two:
Regex code:
/(\[[\w\s]+\])/g
anyone can suggest what needs to be changed in the regex code?
$data = "[Foo Bar],[Suganthan],['Test1',1,5.09,12.50, 7.41]";
but it only finds: [Foo Bar],[Suganthan]
preg_replace('/(\[[\w\s]+\])/', 'replaced', $data);