Re: Array --> If

From: Date: Thu, 06 Nov 2003 02:55:01 +0000
Subject: Re: Array --> If
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168658@lists.php.net to get a copy of this message
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


« previous php.general (#168658) next »