I need a function that extracts all the matches between two start strings to an array.

So...

PHP Code:
ExtractAll 'aacabcaccadcaecafc''a''c'$toArray
now:
$toArray['0'] = a
$toArray['1'] = b
$toArray['2'] = c
$toArray['3'] = d
$toArray['4'] = e
$toArray['5'] = f

I can do more explaining if needed. I'm kinda new to PHP