RE: [PHP] Hi some logic help is required!!!!!
| From: | Ford, Mike [LSS] | Date: | Thu, 14 Mar 2002 12:06:15 +0000 |
| Subject: | RE: [PHP] Hi some logic help is required!!!!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88472@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Balaji Ankem [mailto:balaji.ankem@wipro.com]
> Sent: 14 March 2002 11:51
>
> Hi friend,
> I need some help on this logic...
>
>
> 1. I have some range (A to B) which is fixed and A,B are very large
> numbers.(A<B)
>
> 2. I have X to Y and I want to check this range should not
> match with A
> to B.
>
> How can I check this?
If I understand you correctly, this should do it:
if (($X<$A && $Y<$A) || ($X>$B && $Y>$B)):
// range X-Y is totally outside range A-B
else:
// range X-Y overlaps A-B partially or totally
endif;
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211