Jump to content

define('ADMIN_LOGIN', 'sle09'); // administrator's login


sle09

Recommended Posts

Your existing code is designed to test a single value. Something like -

 

define('ADMIN_LOGIN', 'sle09'); // administrator's login
....
if($some_variable == ADMIN_LOGIN){
// match found 
}

 

To allow it to test multiple values would require that you change the logic to place the multiple values into an array and then use the in_array() function to test if a value matches an entry in the array. Something like -

 

$admins = array('sle09','jjsbsjn');
....
if(in_array($some_variable, $admins)){
// match found 
}

 

 

Your existing code is designed to test a single value. Something like -

 

define('ADMIN_LOGIN', 'sle09'); // administrator's login
....
if($some_variable == ADMIN_LOGIN){
// match found 
}

 

To allow it to test multiple values would require that you change the logic to place the multiple values into an array and then use the in_array() function to test if a value matches an entry in the array. Something like -

 

$admins = array('sle09','jjsbsjn');
....
if(in_array($some_variable, $admins)){
// match found 
}

 

 

 

best answer is here!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.