Question

I have the following piece of code written in C++.

But I'm converting my application to php, just to learning purpose.

And I have this small piece of code.

#define NETWORKMESSAGE_MAXSIZE 16384
unsigned char m_MsgBuf[NETWORKMESSAGE_MAXSIZE];

How I can reproduce this same code on PHP?

Was it helpful?

Solution

As here : W3

You can use PHP pack() Function like this :

<?php
echo pack("C3",80,72,80);
?> 

And

<?php
echo pack("C*",80,72,80);
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top