Fatal error: Function name must be a string whilst it shouldn't

Fatal error: Function name must be a string whilst it shouldn't

我在 PHP 中偶然发现了以下错误:

"Fatal error: Function name must be a string in F:\Applications\xampp\htdocs\BTB_Sandbox\uploads.php on line 15"

而且我不知道真正的问题是什么。这是错误指向的第 15 行:

$error = $_FILES(['file_upload']['error']);

我希望你能帮助我,因为我现在有点卡住了。

您正在使用 $_FILES 作为函数,因为 ()。
这样,PHP 尝试调用一个名为 var $_FILES 值的函数,但这个值不是字符串(这是报告的错误),它是一个数组。

很明显,在你的代码行中你没有使用$_FILES,正确的方法是:

$error = $_FILES['file_upload']['error'];