[drupal-devel] OT: Binary data.

Carl McDade carl_mcdade at yahoo.com
Tue Mar 15 14:06:14 UTC 2005

Do you mean

fgets($handle, 4096);

fgets and fread are binary safe as I know. But there is no function to
calculate the binary size of the data. You have to do this manually.

Carl McDade

Gordon Heydon wrote:
> Hello,
> I know that this may be a little off topic, but I know most people here
> deal with php most of the time. I need to write a little test suite, 
> and
> the only thing that is stopping this from being easy is that I need to
> know how to write a raw integer (4 binary chars) into a socket.
> I can do this with c, it is just...
> int c;
> write(sockfd, c, sizeof(int));
> So what would this be in php.
> I was wondering if someone can shed some light on it.
> Thanks in advance.

More information about the drupal-devel mailing list