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?
You can simply concatenate arbitrary strings with the . operator:
<?php
$s = "a\0b" . "c\0d";
var_export($s); // outputs 'a' . "\0" . 'bc' . "\0" . 'd'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With