int errorcode writeFile(string $filename, var $var[, int $flags]);
This function may pose a security risk and a risk for accidental damage such as data loss; use it carefully. Also, enable potentially destructive functions in the Config Files Options Page for it to work.
•Writes the contents of $var to $filename and returns errorcode. This function is useful for logging purposes. If $var is an array, then writes the entire array with each element (converted to a string) on a new line.
•errorcode (return value)
•3 - no error, but the function is disabled because potentially destructive functions are not enabled (new v11.9942)
•2 - no error, but the variable doesn't exist (or is undefined) so nothing was written (new v11.9942)
•1 - no error, but did not do anything because this function is not supported in the current edition
•0 - normal operation (should have succeeded)
•-1 - could not open $filename
•$flags
•1 - append to the end of $filename instead of overwriting it
•It is most efficient to use this function in the end validation program to write a multi-line array (created using addValue()) to a file instead of writing each line to a file with multiple calls to writeFile()
•New line characters are automatically appended to each line that is written to the file.
•This function is supported only in CSE HTML Validator v7.01 and later.
•This function is only supported in the professional and enterprise editions.
•Functionality change in CSE HTML Validator v11.9942 and later: $var represents a literal string or a variable reference; do not use a literal string like "varname" to represent a variable, instead use $varname