Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    determining if a number is between others

    how can i compare 2 dates with a week ago?

    i just want to know if there is a way to determine whether 4 is in between 1-10 basically. is it possible?

    thank you in advance =)
    poysyn

  • #2
    New Coder
    Join Date
    Jan 2010
    Location
    UT
    Posts
    35
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Something like this?

    PHP Code:
    $number 4;
    $min 1;
    $max 10;

    if (
    $number $min && $number $max) {
    // do something

    Just simple math there. :P

    If not, perhaps you could be more specific about what it is your trying to accomplish?

  • #3
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    I actually use a week date in my coding.

    PHP Code:
    $nextWeek time() + (24 60 60);
    echo 
    "This Week: ("date('Y-m-d') .")";
    echo 
    "Next Week: ("date('Y-m-d'$nextWeek) .")"
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #4
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    As Zoic says you need to be more specific. Your question is far too vague
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)


  •  

    Posting Permissions

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