In the php manual we can read:
fwrite () returns the number of bytes written
Ok ... but what is this "number of bytes written"?
Binary string Binary number? Flow? Int?
I'm a little lost here.
Hi
From the manual :
Description int fwrite (resource $ handle, string $ string [, int $ length])
Description
int fwrite (resource $ handle, string $ string [, int $ length])
int
It returns an int on success, as indicated by the type name immediately before the function name. It returns FALSE on error:
fwrite () returns the number of bytes written, or FALSE on error.
An integer or boolean false on error.
$fh = fopen('/tmp/bar', 'w'); $bytes = fwrite($fh, 'Hello, world.'); var_dump($bytes); // output: int(13)
I found a case where fwrite returns NULL with an E_NOTICE error.This probably occurs when the network stream is interrupted .
fwrite
E_NOTICE
Notice: fwrite(): in .... on line ....