Re: [PHP] looping variables from a file

2004-03-24 Thread Ryan A
Hey John, > $array1 = get_defined_vars(); > include('yourfile.php'); > $array2 = get_defined_vars(); > $newvars = array_diff($array2,$array1); > foreach($newvars as $name => $value) > { echo "$name = $value\n"; } Cool, thanks, will try it out. > If there are multi-dimensional arrays, then > yo

Re: [PHP] looping variables from a file

2004-03-24 Thread John W. Holmes
Second what Rich said, keep replies to the list, please. This can benifit everyone. ---John Holmes... - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "Ryan A" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, Ma

RE: [PHP] looping variables from a file

2004-03-24 Thread Ford, Mike [LSS]
> -Original Message- > From: Ryan A [mailto:[EMAIL PROTECTED] > Sent: 24 March 2004 17:30 > > 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 ha

Re: [PHP] looping variables from a file

2004-03-24 Thread John W. Holmes
From: "Ryan A" <[EMAIL PROTECTED]> > 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 > h

Re: [PHP] looping variables from a file

2004-03-24 Thread Richard Davey
Hello Ryan, Wednesday, March 24, 2004, 5:29:33 PM, you wrote: RA> as you can imagine the above loop will save a crapload of time RA> instead of "partially hard codeing" each key and value but how do RA> I do this while reading from a file? and the other big problem is RA> the file contains one or

Re: [PHP] looping variables

2001-02-08 Thread Michael Dearman
Hey Wen, Had me going there for a bit, cause I had just put down a book on C, where variables are not preceded by such things as $. But for PHP, your missing a few $'s on your variables. And, your taking care of matching that javascript opening tag from where your calling this function? MD Wen