sockets - PHP whitespace before and after a given string need to be considered for byte processing -


i need send 8 bytes given server in socket.

the string should have 8 bytes 3 characters , 5 empty spaces. however, php strips out spaces. how go this?

<?php    $service_name = "pxa     "; //8 bytes    $opt = "code5";     $sendbytes = $service_name . $opt;     //i need sendbytes go pxa     code5    //instead goes pxa code5.          $mysocket->send($sendbytes); ?> 


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -