Hi,
When im writing to files i just use something like this, function and variables.
<?php
// Get The Numbers To Add
$var1 = "1";
$var2 = "2";
// Add The Vars Together
$var = $var1 + $var2;
// File to write final number to
$file = "/path/to/file/to/save/data/to";
// Function to write the file and print the data on-screen
function writedata($str) {
if($fd = @fopen($GLOBALS[ "file"], "a")) {
fputs($fd, $str);
fclose($fd);
echo "$var1 + $var2 = "var";
exit;
}
}
// The above youll see $str which can be any variable name like...
// Call the function from php
write_data($var);
?>
This should help,
Elfyn