how can i pack an object in php and send it over udp?
i have a packet class that has 6 propertis :
i tried a simple client-server app that it send a string over udp but i want to send an object that have different type of data
: I used pack and serialized functions , they were very helpful : ) but i have one more question :
I read manual in php.net but i did not understand how to pack different type of data . i tried this :
$n = ord('a');
$buf = pack('IS',200000000,$n);
$array = unpack('I/S', $buf);
foreach ($array as $key => $value)
echo "\$array[$key] = ". $value ."<br>\n";
$array = 97<br>
why 200000000 was not print ? how can i fix the code?