looping variables from a file

From: Date: Wed, 24 Mar 2004 17:29:33 +0000
Subject: looping variables from a file
Groups: php.general 
Request: Send a blank email to php-general+get-181380@lists.php.net to get a copy of this message
Hi, I have a config_inc.php file which has around 60 parameters set in it. eg: $db_name="something"; $db_user="root"; $db_pass="blah"; $x_installed_path="/home/blah/"; etc I have a requirment of echoing out these statements to the client to show him how his setup is: eg: echo "DB_name=<font color green>".$db_name."</font>"; if I was getting variables via a POST or a GET I would use something like this: foreach ($_POST as $key => $val) { echo "$key=<font color green> $value </font>";} as you can imagine the above loop will save a crapload of time instead of "partially hard codeing" each key and value but how do I do this while reading from a file? and the other big problem is the file contains one or two arrays... Any ideas? Thanks, -Ryan

« previous php.general (#181380) next »