You are here: Re: Display previous month « PHP Programming Language « IT news, forums, messages
Re: Display previous month

Posted by Jerry Stuckle on 11/05/07 14:42

samhale@hotmail.com wrote:
> On 5 Nov, 12:57, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> samh...@hotmail.com wrote:
>>> Hopefully an easy one. Can someone please supply me with the code for
>>> displaying the previous month?
>>> I do not want just -3 from December for October. It needs to work each
>>> month without modifying.
>>> Many thanks
>>> Sam
>> Sam,
>>
>> I'm not sure what you're asking for. Can you clarify this a little more?
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> Jerry,
>
> I am looking for a simple piece of PHP code that will write the
> previous month in full.
> So for example, if it was used now, it would display the text
> 'October'.
> If it was used in April, it would display 'March', etc.
> Sorry I wasn't very clear.
>
> Thanks
> Sam
>
>

Nope, that one fails on March 31st, for instance.

How about:

echo date("F",strtotime(-date('j') . ' days'));

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация