Take the 2-minute tour ×
  1. I want to get the date of the month without having the 0 in front.
    For example, this month is April. Date(m) indicates April as 04, not 4. Is there any way to do it?
  2. Is it possible to set the array as String itself?

For example,


I do understand that when you fetch the result of array [1], it will be 2012, not 2012. I want it to be set such that when you retrieve the result of an array, it will be 2012.

share|improve this question
You might want to try rephrasing the 2nd part of your question - I'm not sure I understand it. –  cmrn Apr 30 '12 at 2:11
To get the date of the month, you simply do date('j'). I assume you are pertaining "the result of array [1], it will be 2012, not 2012" to "the result of array [1], it will be 2013, not 2012"? –  deex Apr 30 '12 at 2:13
add comment

1 Answer

up vote 1 down vote accepted

You can see the date() formats here. In your case, you would use 'n'.

Yes, you can set array values like that (if I understand your question... I think you have a typo "it will be 2012, not 2012".

share|improve this answer
i think he wants 2012 not 2013 –  anselm Apr 30 '12 at 2:12
Hello, because when i call the array it comes out as 1, not 2012 as stated above. That's why thank you for the answer for date(n). It works perfectly. –  user127886 Apr 30 '12 at 2:28
i think he don't know what he wants to do... like u said typo... or all –  Coder Apr 30 '12 at 6:56
add comment

Your Answer


