$date = time(); echo displayDate($date); // Output: Thursday, 25-Nov-21 07:20:04 EST
$date = strtotime('2021-11-25'); echo displayDate($date); // Output: Thursday, 25-Nov-21 00:00:00 EST
$date = strtotime('2021-11-25'); echo displayDate($date, 'Y-m-d'); // Output: 2021-11-25In this example, the displayDate function is used to print the formatted date for the given timestamp with a custom format. We have passed 'Y-m-d' as the second argument to print the date in the format 'year-month-date'. Overall, the displayDate function is a basic yet crucial function in PHP, used widely in many applications to display dates in user-friendly formats.