Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 socket_recv 函数接收二进制数据。php中是否有某种方法可以将它们合并为一个,以便我仍然可以像使用二进制字符串一样使用它们?
您可以使用运算符简单地连接任意字符串.:
.
<?php $s = "a\0b" . "c\0d"; var_export($s); // outputs 'a' . "\0" . 'bc' . "\0" . 'd'