How does PHP send a byte to a port of an IP address? For example, if a byte is sent to Port 2012 of port 202.117.120.241, and the 8-bit bytes are 00100000, how can this problem be achieved ?, $ Fp = fsoctopen ('192. 117.120.241 ', 202); fwrite ($ fp, chr (how does bind PHP send a byte to a port of an IP address?
For example, if you want to send a byte to Port 2012 of port 202.117.120.241 and the 8-bit bytes are 00100000, how can this problem be implemented?
------ Solution --------------------
$ Fp = fsoctopen ('192. 117.120.241 ', 202 );
Fwrite ($ fp, chr (bindec ('20140901 ')));
------ Solution --------------------
Fsocketopen ();
------ Solution --------------------
Dizzy ..
Fsockopen ();
------ Solution --------------------
PHP code
$ Fp = fsockopen ('192. 117.120.241 ', 202, $ ercode, $ ermsg); if ($ ercode! = 0) exit ('Error: '. $ ermsg); $ st = sprintf ("% B", 00100000); fread ($ fp, $ st );
------ Solution --------------------
This is probably because the host of 202.117.120.241 does not listen to Port 2012. This is not caused by code problems.
In addition, I wrote
$ St = sprintf ("% B", 00100000); is incorrect. I have incorrect understanding of binary bytes. The first floor is correct.