Isn't Using the basename function with $_FILES['userFile']['name'] Redundant?

后端 未结 3 1028
野性不改
野性不改 2021-01-01 06:15

According to the POST method uploads section of the PHP Manual, $_FILES[\'userfile\'][\'name\'] is the original name of the file on the client machine. Example

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 06:35

    using basename() on a full path eg /path/mydir/file.txt, returns you file.txt. Its useful when you have a full path to parse and you just want to get the last part of the path.

提交回复
热议问题