Re: [PHP] A better way to do this

2005-10-23 Thread Jasper Bryant-Greene
On Sun, 2005-10-23 at 20:23 +0100, Ross wrote: > I want the selct table to retain it's value on submit. The way I have done > it works but is a bit rubbish and was wondering if there is a more efficient > way. I just make the variable equal to "selected" when the form is submitted > > >

Re: [PHP] A better way to do this in php???

2004-10-21 Thread Brent Baisley
Here's a one liner that gives the minutes since midnight: floor( (time()-mktime(0,0,0, date( 'm' ), date( 'd' ), date( 'Y' )))/60); Both time() and mktime() return the seconds since epoch. Time is based on current time, and the mktime parameters base it on midnight. A simple subtraction gives y

Re: [PHP] A better way to do this in php???

2004-10-20 Thread Robert Cummings
On Wed, 2004-10-20 at 19:37, [EMAIL PROTECTED] wrote: > Why not use the date function? > > date("g:i a"); The OP wants to get the time based on a value indicating the number of minutes since midnight. He doesn't want the current time. The following should give him what he needs: $iMinutes =

Re: [PHP] A better way to do this in php???

2004-10-20 Thread trenton
Why not use the date function? date("g:i a"); Trenton > I need to find the exact time of day using "minutes since midnight". > > What is the easiest and/or better way to do this in php? > > This is how I'm doing it now. > > // $iMinutes is the total number of minutes since midnight/12am > // 0 =