I am new to the world of coding as well as PHP and befuddled by what the '-01' does in the code below.
strtotime($someYear . '-' . $someMonth . '-01');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s selecting the first day of the month.
.is the string concatenation operator in PHP, and PHP will convert numbers to strings automatically.So let’s say you had:
And you want the timestamp of the start of that month, you could it do it with that:
This is a bit ugly, but it works.