I have a function i'm building and I would rather not have it return the year or the seconds. Is there a way to format the date output when I echo this function?
function estOptions($db) {
$opts = "'<option value=''>- New Estimates -</option>\n";
$sql = "SELECT id, customer, salesman, status, location_address, date
FROM jobs
ORDER BY status";
$res = $db->query($sql);
while (list($id, $customer, $salesman, $status, $location_address, $date) = $res->fetch_row()) {
$opts .= "<option value='$id, $customer, $salesman, $status, $location_address, $date'>$id, $customer, $salesman, $status, $location_address, $date </option>\n";
}
return $opts;
}
I was wanting to format it like:
date("jS F h:i A")
Any help would be greatly appreciated, thanks!
OGBugsy