RE: Array --> If
| From: | Jason Williard | Date: | Thu, 06 Nov 2003 03:10:04 +0000 |
| Subject: | RE: Array --> If | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168664@lists.php.net to get a copy of this message | ||
Thanks! That did the trick.
Jason Williard
-----Original Message-----
From: Greg Beaver [mailto:greg@chiaraquartet.net]
Sent: Wednesday, November 05, 2003 6:55 PM
To: Jason Williard
Cc: php-general@lists.php.net
Subject: Re: Array --> If
Hi Jason,
perhaps:
<?php
$cases = array(5, 15, 30, 60, 90, 120);
if (in_array($count, $cases)) {
include 'page.php';
}
?>
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Jason Williard wrote:
> I am building a script that I would like to have do a specific task
> based on whether specific counts have been reached.
>
> Basically, the script checks for connectivity in a specific port. If
> the connectivity fails, it increases the count by 1. It does this
every
> minute. I would like the script to page me at specific marker points
> (i.e. 5, 15, 30, 60, 90, 120, etc). Is there anyway to make an if
> statement or something similar to run in any case where the COUNT
value
> equals one of the numbers in the array?
>
> Example:
>
> $cases = array( 5, 15, 30, 60, 90, 120 );
>
> if ( $count = {ITEM IN $cases} ) {
> EXECUTE PAGE
> }
>
> Thanks,
> Jason Williard