[PHP] assign values to variables, all taken from txt file

2001-05-15 Thread Alain
Hello, I am trying to get values assigned to variables, by taking these data from a textfile. my txt file looks like that: variable1 // value1 variable2 // value2 etc... The point here is that I want to be able to get BOTH the variable name and its corresponding value.. I tried things like:

Re: [PHP] assign values to variables, all taken from txt file

2001-05-15 Thread Tobias Talltorp
From what I could see you want variable variables $value = $line[0]; $variable = $line[1]; $$variable = $value; // Tobias Alain [EMAIL PROTECTED] wrote in message 9dqrh1$23a$[EMAIL PROTECTED]">news:9dqrh1$23a$[EMAIL PROTECTED]... Hello, I am trying to get values assigned to variables, by

Re: [PHP] assign values to variables, all taken from txt file

2001-05-15 Thread Alain
So now my code looks like: --- $configuration_data = file(configuration.txt); for($index=0; $index count($configuration_data); $index++) { $line = explode( // ,$configuration_data[$index]); $value = $line[0]; $variable = $line[1]; $$variable = $value; echo