You are here: Re: strtotime - Monday of current week « PHP Programming Language « IT news, forums, messages
Re: strtotime - Monday of current week

Posted by Krustov on 10/11/07 22:30

<comp.lang.php>
<Chris>
<Thu, 11 Oct 2007 15:05:04 -0700>
<1192140304.180826.282650@g4g2000hsf.googlegroups.com>

> I am trying to output Monday of the current week i.e. if Monday is the
> 8th I want to display 'Monday 8th' for any date between Monday 8-14th.
>
> I would appreciate any help, the code below is heading in the right
> direction but doesn't quite give me the results I am looking for.
>
> $givenday = mktime(0,0,0,10,08,2007);
> $Monday = strtotime("Monday this week",$givenday);
> echo date("j M Y H:i:s", $Monday);
>

<?php

$less=0;

$loopy=1;
while ($loopy<8)
{
$temp1=date("l dS",time()-$less);
$temp2=date("l dS M Y H:i:s",time()-$less);
$wsx=" $temp1 "; $qaz=strpos($wsx,"Monday"); if ($qaz==true) {break;}
$less=$less+86400;
$loopy=$loopy+1;
}

print "temp1 = $temp1 <br>";
print "temp2 = $temp2 <br>";

?>


--
www.vhit.co.uk
www.jpgimage.co.uk
www.phpwhois.co.uk
www.cannabiswindow.co.uk

 

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

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