Source Code:
(back to article)
<?php function get_day_name($date) { // Convert the date to a timestamp $timestamp = strtotime($date); // Return the day name return date('D', $timestamp); } // Test the function echo get_day_name('2022-01-10'); // Output: Mon
Result:
Report an issue