小编Ome*_*xlu的帖子

PHP 消息:PHP 致命错误:未捕获类型错误:无法访问字符串上字符串类型的偏移量

我收到以下错误:

\n
PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string\n
Run Code Online (Sandbox Code Playgroud)\n

在这一行:

\n
if ($uploadZoneData[1]['size'] != 0) {\n
Run Code Online (Sandbox Code Playgroud)\n

在 php 7.4 上我有任何麻烦,但在 php 8 上我有。

\n

可能是什么问题?

\n

编辑:相关功能的完整代码:

\n
function uploadSingleFile($zoneImage, $fileMoveTo, $fileAllowedExtensions, $fileAllowedSize, $zoneCustomer, $zone)\n{\n    global $config;\n\n    // define file upload settings\n    $errors = array();\n    $fileName = $zoneImage['name'];\n    $fileSize = $zoneImage['size'];\n    $fileTmp = $zoneImage['tmp_name'];\n    $fileType = $zoneImage['type'];\n    $fileExt = strtolower(end(explode('.', $zoneImage['name'])));\n    $MBtoByte = $fileAllowedSize * 1048576;\n    $extensions= $fileAllowedExtensions;\n\n    // define …
Run Code Online (Sandbox Code Playgroud)

php string nginx typeerror offset

21
推荐指数
1
解决办法
15万
查看次数

标签 统计

nginx ×1

offset ×1

php ×1

string ×1

typeerror ×1