3

I am receiving binary data with socket_recv function. Is there some way in php to merge them into one so I can still work with them as with binary strings?

4

1 に答える 1

6

.演算子を使用して、任意の文字列を簡単に連結できます。

<?php
$s = "a\0b" . "c\0d";
var_export($s); // outputs  'a' . "\0" . 'bc' . "\0" . 'd'
于 2012-04-18T17:29:55.763 に答える