我在执行状态脚本时看到以下错误:
Warning: Cannot use a scalar value as an array in
$result[$array[$i*2]] = $array[$i*2+1];
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?我已经包含以下完整代码:
<?php
// Set the host and port
$host = "ip_goes_here";
$port = port_goes_here;
// Open the socket connection to the server
$fp = fsockopen("udp://".$host, $port);
// Set the string to send to the server
$string = "\xff\xff\xff\xffgetinfo";
// Set the socket timeout to 2 seconds
socket_set_timeout($fp, 2);
// Actually send the string
fwrite($fp, $string);
// Read the first 18 bytes to get rid of the …Run Code Online (Sandbox Code Playgroud)