PHP:Array and string offset access syntax with curly braces is deprecated错误的解决办法
 admin 阅读:119 2024-02-29 
                    PHP 程序换了个服务器后,报错:Array and string offset access syntax with curly braces is deprecated,这是因为 PHP7.4 版本之后不再支持使用大括号:{}访问数组以及字符串的偏移,必须统一使用中括号:[]。
错误:
$seq = (ord($value{0}) % $rule['num']) + 1;正确:
$seq = (ord($value[0]) % $rule['num']) + 1;注意红色位置。
声明
                        
                        1、部分文章来源于网络,仅作为参考。 2、如果网站中图片和文字侵犯了您的版权,请联系1943759704@qq.com处理!



