The cart is empty


(FW >= 1.0)

fwrite - Write data to a file, socket or stream


int fwrite( int $handle, mixed $data )

This will write the data passed in $data to the resource previous opened



handle of open file


The data to be written. This can be a string, number or array of data.  If a number is passed it will write 8 bits.
If an array is passed as a parameter, the data can contain both numbers (int) and strings.  This can be useful when writing binary data to a stream such as a socket.

Return Value

1=success, 0=failure


$fp = fopen("/test.txt","w");
if (!$fp) {
    print("File open failed\n");
} else {
$res = fwrite($fp,"Testing this write");
if ($res) {
print("An error occured while trying to write to the file");
} fclose($fp); } ?>