Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2010, 09:13 PM   PM User | #1
poysyn
New Coder

 
Join Date: Jan 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
poysyn is an unknown quantity at this point
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
poysyn is offline   Reply With Quote
Old 01-17-2010, 09:18 PM   PM User | #2
Zoic
New Coder

 
Join Date: Jan 2010
Location: UT
Posts: 35
Thanks: 1
Thanked 3 Times in 3 Posts
Zoic is an unknown quantity at this point
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?
Zoic is offline   Reply With Quote
Old 01-17-2010, 10:11 PM   PM User | #3
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
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?
masterofollies is offline   Reply With Quote
Old 01-18-2010, 02:15 AM   PM User | #4
JAY6390
Regular Coder

 
Join Date: Dec 2009
Location: UK
Posts: 495
Thanks: 0
Thanked 58 Times in 58 Posts
JAY6390 is on a distinguished road
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 :)
JAY6390 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:53 PM.


Advertisement
Log in to turn off these ads.