Hi all
I have a simple php function which does other things amongst pulling some variables from the database.
In the function, they enter
getServerInfo($server, $centre, $host)
in the function, I have a long winded IF script to get the different variables
if($server == “1”){
$servername = $database[‘server1_name’];
} elseif($server == “2”)
etc…
Can I set it up so that it just automatically looks at the right server number depending on what they enter.
E.g.
$servername = $database[‘server$server_name’];
$serverlocation = $database[‘server$server_location’];
Would make life a lot easier?
Thanks!