gpt4 book ai didi

php - 结束( explode )严格标准 : Only variables should be passed by reference in

转载 作者:可可西里 更新时间:2023-10-31 23:54:44 25 4
gpt4 key购买 nike

我有这段代码来获取文件的扩展名:

$extension = end(explode(".", $_FILES["rfile"]["name"]));

这在本地主机上工作正常,但是当我上传在线托管时,它给了我这个错误:

Strict Standards: Only variables should be passed by reference in...

最佳答案

为什么不使用 pathinfo (PHP >= 4.0.3),即:

$ext = pathinfo($_FILES["rfile"]["name"])['extension'];

现场 PHP 演示

http://ideone.com/eMpbnL

关于php - 结束( explode )严格标准 : Only variables should be passed by reference in,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33127618/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com