//how to initialize byte[10240] in php
var svr = new TcpClient();
svr.Connect(127.0.0.1, 8081);
var ns = svr.GetStream();
var outputBuffer = new byte[10240];
var pkgLen = 11
ns.Write(outputBuffer, 0, pkgLen);
I have the above C# code an I am trying to convert the code to PHP. Here is my code in php:
<?php
/* Create a TCP/IP socket. */
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$message = //empty array of byte
socket_send($socket, $message);
socket_close($socket)
?>
My question is how to create an empty array of byte of length 10240 in php? Also the socket_send function takes a string not an array.