I have a large chunk of data that i'm using the below code to explode using an array of keywords, basically the data i have is sections which i need to split up, but there are potentially more than 3 sections in some cases.
$string = "start time 00:30 mid time 00:45 end time 01:00"
$delim = array('start', 'mid', 'end');
$step_01 = str_replace($delim, '+delim+', $string); //Extra step to create a uniform value
$exploded_string = explode('+delim+', $step_01);
//=> time 00:30 => time 00:45 => time 01:00
If there is four sections, it will print out this
//=> time 00:30 => time 00:45 => time 01:00 => time 02:00
What i need to know, is there a way of finding out the matched keyword from the array to each section, e.g  = "End"
Or possibly when a match is found, making a new array matching keywords to array parts?
I'm a bit stuck on this! any help is much appreciated.