对视频上传表单中的PHP语句感到困惑

时间:2015-11-13 22:59:29

标签: php html video web

$ file_ext =用strtolower(端(爆炸('',$ _ FILES ['图像'] ['名称'])));

http://www.tutorialspoint.com/php/php_file_uploading.htm< - 在本教程中,上面的语句根据$ expension定义检查是否允许文件扩展名,但是我收到错误:

严格标准:只应在第33行的/home/tstsit82/public_html/register.php中通过引用传递变量

代码有效,但此警告也会输出。有什么问题和解决方案?

由于

1 个答案:

答案 0 :(得分:1)

本质上,错误的含义是你应该有一个调用end()的变量 - 而不是另一个函数的返回(在这种情况下,爆炸)。

要重新编写没有错误的代码,您可以执行以下操作:

<?php
$filearr = explode('.',$_FILES['image']['name']);
$file_ext=strtolower(end($filearr));