|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-08-19 15:50 UTC] php at richardneill dot org
Description: ------------ fwrite() outputs to file as a string. While this is usually a sensible default, it can be rather annoying when I actually want to output raw data. I know about using chr(), but that's ugly at least. My request: add an option to fwrite that lets you output a char, rather than a string. [The chr() workaround is also not very visibly documented]. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 02:00:01 2025 UTC |
That seems too low-level to me. As PHP strings may contain arbitrary bytes, you can easily build up the desired output string(s) with pack('c*', ...) and write this/these to the file.