|
Posted by samhale on 11/05/07 15:11
On 5 Nov, 14:42, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> samh...@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.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -
Seems to work fine. Many thanks for your help.
[Back to original message]
|