php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18143 writing binary number as raw binary
Submitted: 2002-07-03 12:57 UTC Modified: 2002-07-03 13:21 UTC
From: ericksbr at infocon-inc dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.1.2 OS: Windows NT 4.0 SP 5 (Intel)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ericksbr at infocon-inc dot com
New email:
PHP Version: OS:

 

 [2002-07-03 12:57 UTC] ericksbr at infocon-inc dot com
Basically, what I want to do is write the
hexadecimal value "0x0F000000L" out to a file,
without it being converted to a string.
I am using a C program to read the file and
the results don't match.

// #define COUNT_FLAG		0x0F000000L
define("COUNT_FLAG", "251658240", FALSE);
// define("COUNT_FLAG", "0x0F000000", FALSE);
	// Open file
	$fp = fopen($sTempFileName, "ab");

	fwrite($fp, COUNT_FLAG);
	// Copy Count
	fwrite($fp, $nCopyCount);
	fwrite($fp,
		intval(COUNT_FLAG)
		);
	fwrite($fp,
		serialize(intval($nCopyCount))
		);
	fclose($fp);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-03 13:21 UTC] sander@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.

Hint: use chr()
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC