i have a text file with variables saved in it like:
audB = 10.01
audS = 5.06
and so on
i’m trying to read the text file name the variable and give it a value using this
php
$handle = @fopen(“ex_rate.txt”, “r”);
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
list( $key, $value ) = explode( ‘|’, trim($buffer) );
$$key = $value; //Double $$ to set a var with the string name in $key
}
if (!feof($handle)) {
echo “Error: unexpected fgets() fail\n”;
}
fclose($handle);
}
echo $audB.$audS ;
php
it will not echo or print the variable… what am i doing wrong?