".
$s
."";
}
function data2file($filename, $content)
{
if (! is_writable( dirname($filename) )) {
print "Non scrivibile (".dirname($filename).")
";
return FALSE;
}
if (!$handle = fopen($filename, 'w')) {
print "Cannot open file ($filename)
";
return FALSE;
}
if (fwrite($handle, $content) === FALSE) {
print "Cannot write to file ($filename)
";
return FALSE;
}
fclose($handle);
return TRUE;
}
function array2yamlfile( $r, $fname ) {
//TODO: Gestione errori
$sYAMLdata = yaml_emit ( $r );
echo "write to ".$fname;
$fp = fopen ( $fname, 'w' );
fwrite ( $fp, $sYAMLdata );
fclose ( $fp );
}
?>