How do I check if a directory is writeable in PHP?

前端 未结 10 1606
别跟我提以往
别跟我提以往 2021-01-01 08:07

Does anyone know how I can check to see if a directory is writeable in PHP?

The function is_writable doesn\'t work for folders.

Edit: It doe

10条回答
  •  南方客
    南方客 (楼主)
    2021-01-01 09:05

    stat()

    Much like a system stat, but in PHP. What you want to check is the mode value, much like you would out of any other call to stat in other languages (I.E. C/C++).

    http://us2.php.net/stat

提交回复
热议问题