Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default Needing a hand with PHP

    Okay I was thinking... If I had Next DJ, its simple but I need a hand.

    PHP Code:
    <?
    $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

  2. #2
    Join Date
    Jun 2005
    Location
    Manchester
    Posts
    3,187
    Tokens
    0

    Latest Awards:

    Default

    Couldn't you make a simple PHP clock and use that in the variable, although I don't get what you mean lol.

    - Dan

  3. #3
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?
    $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?

  4. #4
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    $time date("G"); 
    That puts the hour in 24 hour format (oh and the G is case sensitive).
    kinda quit.

  5. #5
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    Okay thanks dude

    PHP Code:
    $next '$time + 1'
    How can I get that to work?

    Rep added+

  6. #6
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    mmmm, Bump.

    Sorry "/

  7. #7
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    $time date("G");
    $next $time++; 
    kinda quit.

  8. #8
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    Thanks, Ive got it working now...

    Thread closed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •