I have a string, that I want to analyse and load into an array. The string looks something like this:
Code: Select all
"<something>[blah][dkl][ilow]<somestring>[fdskl][iloveu]<anotherone>[dfsk]"Code: Select all
Array
(
['something'] => Array
(
[0] => blah
[1] => dkl
[2] => ilow
)
['somestring'] => Array
(
[0] => fdskl
[1] => iloveu
)
['anotherone'] => Array
(
[0] => dfsk
)
)I know that this can be done some loops in combination with strpos, but I don't like this approach. Does anyone have a cool idea how to do this job in a smart, and primarily fast way? I guess some regex magic could be used, but I don't know how at the moment.