echo date(‘W’);
It gives me "06", but I only want 6, instead of 06. Is there a way to get the week of year in single character if the week is less than 10. I have couple of ways to deal with this, like:
- Check if week is less than 10, then use substring.
- etc..
Is there any more convenient way?
Couldn’t you just convert it into a int using
intval().