PDA

View Full Version : Needing a hand with PHP



Luckyrare
27-12-2005, 10:11 PM
Okay I was thinking... If I had Next DJ, its simple but I need a hand.


<?
$time = 'H';
if($time == '1') {
echo 'DJ-One';
} elseif($time == '2') {
echo 'DJ-Two';
}
?>

How can I put the time as '$time'?

I hope you get me

Then I could do something like $djtime = '$time + 1' ?

Works on 24 hour clock

Thanks ;)

Dan Williamson
27-12-2005, 10:18 PM
Couldn't you make a simple PHP clock and use that in the variable, although I don't get what you mean lol.

- Dan

Luckyrare
27-12-2005, 10:20 PM
<?
$time = 'H'; // Gets the hour 1/24
if($time == '1') { // If the time is 1am it will show 'DJ-One'
echo 'DJ-One';
} elseif($time == '2') { // If the time is 2am it will show 'DJ-Two'
echo 'DJ-Two';
}
?>

ECT ECT? :D

nets
27-12-2005, 10:46 PM
$time = date("G");
That puts the hour in 24 hour format (oh and the G is case sensitive).

Luckyrare
28-12-2005, 08:56 AM
Okay thanks dude


$next = '$time + 1';

How can I get that to work?

Rep added+

Luckyrare
28-12-2005, 04:47 PM
mmmm, Bump.

Sorry "/

nets
29-12-2005, 12:07 PM
$time = date("G");
$next = $time++;

Luckyrare
29-12-2005, 12:17 PM
Thanks, Ive got it working now...

Thread closed

Want to hide these adverts? Register an account for free!