I used DateTime::createFromFormat and vsprintf to construct a time string from the array, and came up with this:
<?php
$endDate = array(
'month' => '05',
'day' => '30',
'year' => '2017',
'hour' => '10',
'min' => '48',
'meridian' => 'pm'
);
$date = DateTime::createFromFormat('d/m/Y h:i a', vsprintf('%s/%s/%s %s:%s %s', [
$endDate['day'],
$endDate['month'],
$endDate['year'],
$endDate['hour'],
$endDate['min'],
$endDate['meridian'],
]));
echo $date->format('d/m/Y h:i a');
Outputs (and you can tweak the format:
30/05/2017 10:48 pm
Actually you probably don't even need to use DateTime but I would suggest you do as you can then further manipulate it (add time intervals or change the format), you could probably just do:
printf('%s/%s/%s %s:%s %s', [
$endDate['day'],
$endDate['month'],
$endDate['year'],
$endDate['hour'],
$endDate['min'],
$endDate['meridian'],
]
Demo: https://eval.in/778600