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 "$variable:<b>$value</b><br>\n";
}
echo "$admin_email$sys_host$root_path$www\n<hr>\n";
------------------------------------
And there is still something wrong, because it does print me a
good list $variable_name:corresponding_value from the echo
inside the loop, but the echo at the end doesn't return any value...

I'm still missing something there...  :(
-Alain-


""Tobias Talltorp"" <[EMAIL PROTECTED]> wrote in message
9dr0g8$cgs$[EMAIL PROTECTED]">news:9dr0g8$cgs$[EMAIL PROTECTED]...
> 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 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:
> > ----------//-----------
> > $configuration_data = file("conf/configuration.txt");
> > for($index=0; $index < count($configuration_data); $index++)
> > {
> > $line = explode("//",$configuration_data[$index]);
> > $value = "$line[0]";
> > $variable = "$line[1]";
> > $"\$variable" = "$value";
> > }
> > ----------//------------
> > So it's that "$"\$variable" = "$value";" which is wrong and now I don't
> have
> > any inspiration anymore...
> >
> > Could somebody help me pleeeease?!
> > thanks,
> > -Alain-
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to