* Thus wrote Steve Buehler ([EMAIL PROTECTED]):
> 
> What I would like to do is to have an array earlier in the script of just 
> the items that it is checking for so that it can be more easily changed if 
> I put this out as free or shareware software.  Here is what it might look 
> like, but I know that if this is possible, it probably won't look at all 
> like this:
> 
> $array=("/etc/bind/options.conf.wp","/etc/bind/rndc.conf.wp","/etc/bind/keys.conf.wp");
> if($k2b==$array){
>       do this1
> }else{
>       do this2
> }

Close, but not close enough :)

if (in_array($k2b, $array) ) {
  // do this1
}

http://php.net/in_array

Although depending on the situation I usually set up array's of
this type like this:

$arr = array(
  '/etc/bind/options.conf.wp' => true,
  '/etc/bind/rndc.conf.wp' => true 
  );

Then my condition is:

if (@$arr[$k2b]) {
  // do this1
}


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to