https://www.php.net/manual/en/function.fopen.php Their documentation doesn't list the 'b' flag in the table but it does in the description and example.