On Sat, 2007-01-06 at 14:46 +0200, Steven Macintyre wrote:
> Um ... can anyone point me to somewhere that it explains this ...
>
> I am trying to convert a "int" (1 through 7) to a day name (Monday through
> Friday) while in a loop with mysql results
>
> I have tried $day = date('w', $day);
>
> But this does not seem to work ... can anyone assist?
Something like:
<?php
$monday = strtotime( "next monday" );
for( $i = 0; $i < 7; $i++ )
{
echo date( 'w', $monday + (24 * 60 * 60 * $i) )."\n";
}
?>
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php