I tried this now:
$array = preg_split("/[(.*?)]/" ,$string, -1, PREG_SPLIT_DELIM_CAPTURE );
But the problem is that it still gives the stuff between these tags too, so it doesnt help. I would only need text inside [].
with a string "[test]test2 [test3]" , i get an array with these cells:
0:
1:test
2:test2
3:test3
4:
Reto wrote:
Have you tried this in preg_match?
pattern="/[(.*?)]/";