Typical of PHP, it’s very easy to get the day of the week from a date, but they also provide the data in multiple format. Three in fact.
The first, and arguably the most straight forward is to get the textual name of the day of the week.
That’s all well and good, unless you need the day of the week in a language other than English. In that scenario you could get a numerical value for a date and conver it yourself.
Of course there are two different numbering schemes. The first and older numbering schemes is zero-based starting with Sunday.
The second numbering scheme, added in PHP 5.1 conforms to ISO-8601. It starts with 1 for Monday and moves Sunday to the end at 7.