I'm stuck. I have this php code that basically loops through a file and puts it all in a variable. But is there a way to save that variables info to a new file or in an existing one???


<?php

$lines = file('storage.xml');
$vars = "";

foreach ($lines as $line_num => $line) {
$vars .= htmlspecialchars($line) . "<br />\n";
}

echo $vars;
?>

is there a way to put the contents of $vars in to a blank file (basically creating a new one) or an existing xml file???

thanks, your help is much appreciated