I am looking for a way to combine multiple movie showtimes into a single string. The data we get from our source has a couple of instances of a specific movie playing at a specific theater on a specific day, but having two listings in the XML because the theater serves alcohol and is playing the movie in a regular theater and the boozy theater.

Here are two examples of movie showtime strings that we get from our data source:

1. 8:00, 10:30, 11:40 PM
2. (11:20 AM), (4:40), 8:00, 11:40 PM

* ()'s denote a matinee showing.

With those showtime strings, I need it to look like this:

* (11:20 AM), (4:40), 8:00, 10:30, 11:40 PM

I have no problem removing duplicates from the strings (8:00, for example), but I am struggling with how to best combine the strings into a single, cohesive unit.

Does anybody have any recommendations on how to do this in PHP? The server this needs to run on has 5.3.something

Edit - Code
I don't think this is going to make a whole bunch of sense, because it is part of a larger script I'm editing

```
//Make a unique key so we can check if a movie listing already exists for this combo
$showtimesKey = implode('_', array(
    (string)$currentShowTime->theater_id,
    (string)$currentShowTime->movie_id,
    (string)$currentListing['date']
));
if (!isset($justShowtimes[$showtimesKey])) {
    foreach (explode(", ", trim($currentListing->showtimes)) as $time) {
        $justShowtimes[$showtimesKey][$time] = $time;
    }
} else {
    $previousTimes = $justShowtimes[$showtimesKey];
    foreach (explode(", ", trim($currentListing->showtimes)) as $time) {
        $justShowtimes[$showtimesKey][$time] = $time;
    }
    natsort($justShowtimes[$showtimesKey]);
    //sort($justShowtimes[$showtimesKey], SORT_STRING);
    $currentListing->showtimes = $justShowtimes[$showtimesKey];
}

```