How to get day name from date in php?

This is a short guide on how to get full day name from date in php. i would like to show you php date get full day name.

1. Code:

     <?php 	
	function getDayNameOfWeek($date) {
		return date('l', strtotime($date));
	}
        $date = "2022-06-27";	
	echo(getDayNameOfWeek($date));
    ?> 

2. Example:

Input:

"2022-06-27";
"2022-06-30";

Output:

Monday 
Thursday