Category: PHP5
Added: 17th of January 2016
Updated On: 28th of October 2020
Viewed: 1917 times
One thing I noted, you will get varying results if you try to get the day of the week from a specified date in PHP if you submit your date in the following format dd/mm/yy.
What you need to do is replace / with - in your date using the str_replace function, convert the date to a unix timestamp, then use the date function with l switch, which will give you the proper day of the week.
Copy and paste the code below. The code will display Wednesday
Other Tips & Tutorials
PHP5
Get the day of the week for a specified date using PHP5Posted: 17th of January 2016
Views: 1917
PHP5
Count the number of elements in a PHP array using the count() functionPosted: 15th of December 2015
Views: 1032
PHP5
Pass ampersand through query strings in URL using PHP5Posted: 27th of November 2015
Views: 2380