Strict Standards Error while image upload with PHP script

后端 未结 2 1778
悲&欢浪女
悲&欢浪女 2021-01-27 10:05

I try to write an image uploader with php. But it is giving an error when I try.

Error is:

Strict Standards: Only variables

2条回答
  •  感动是毒
    2021-01-27 10:40

    The way to fix this is to explode first then use that array in end. end() needs to get its parameter passed by reference because it manipulates internal pointer but if there is no variable reference it will not work correctly.
    Try this
    $array = explode(".", $file_name_encrypted);
    then
    $extension = end($array);

提交回复
热议问题