无法将空字符串分配给字符串偏移量
问题描述:
我刚刚安装了PHP 7.1,现在看到此错误:
I've just installed PHP 7.1 and now I am seeing this error :
PHP Warning: Cannot assign an empty string to a string offset in /postfixadmin/variables.inc.php on line 31
第31行:
$fDomains[0] = "";
现在如何在PHP 7.1中清除$ fDomains [0]?
How does on clear $fDomains[0] now in PHP 7.1?
答
这是因为您要在第一个元素上取消设置字符串.只需使用substr($fDomains, 1);
It's because you want to unset a string at the first element. just use substr($fDomains, 1);