小编Jul*_*nez的帖子

警告:不能将标量值用作数组

我在执行状态脚本时看到以下错误:

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)

php arrays scalar

16
推荐指数
1
解决办法
5万
查看次数

标签 统计

arrays ×1

php ×1

scalar ×1