Well thanks for the leads. I have gotten it done. Here is the code
$string = "Osceola: bridge, high school, library; Bands: American Head Charge, Smilin Liar, Stigma; test it all out this should not show up but THIS: should, work, now huh;";
preg_match_all("/[\w\d_-]+:/", $string, $cat);
$subcat=split("[ [:alnum:]]+:", $string);
for($i=0;$i<count($subcat)+1;$i++){
$cat_full = $cat[0][$i];
if($cat_full!=""){
$subcatsplit = explode(",", $subcat[$i+1]);
foreach($subcatsplit as $key=>$value){
echo str_replace(":", "", $cat_full)."".str_replace(";", "", $value).", ";
}
echo "<br>";
}
}
It will output this
Osceola bridge, Osceola high school, Osceola library,
Bands American Head Charge, Bands Smilin Liar, Bands Stigma,
THIS should, THIS work, THIS now huh,
I know the code is not pretty but it works and this is not live code, only for our internal use where performance isn't the issue but getting it to work is.
Now I just gotta get it to do multiple word categories