Hello,
I'm new to php and so am hoping that you can help. What I want to do is read from a config file, put the contents into an array, trim the whitespace. I then want to iterate through the array by line and split it into sets of three variables along a '|' symbol.
So far I have the following code but I think I'm mixing php and perl and not coming up with anything usable . . .
function read_order_config (){
$contents = fopen ($ORDER_CONFIG, "r") or die ("Couldn't open file");
$pricetable = fread ($contents, filesize ($ORDER_CONFIG));
fclose($contents);
$trimmed = chop($line);
foreach $trimmed($pricetable){
($lev, $var, $value) = split ("|", "$line")
}
}
Are fopen and fread the right way of going about this?
I will much appreciate anyone's help with this. Thanks, Rebecca