How to create destination (Folder) in PHP while using move_uploaded_file()?

前端 未结 5 1421
无人共我
无人共我 2020-12-29 06:41

I want to upload files with PHP and i use move_uplload_files to copy them to the destination folder I want, everything works fine with this :

if (move_upload         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 07:39

    Use something like this:

    $folder = "uploads"; 
    if(!is_dir($folder)) mkdir($folder);
    

    is_dir() checks if the folder is there.

提交回复
热议问题