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

前端 未结 10 1622
别跟我提以往
别跟我提以往 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 08:49

    According to the documentation for is_writable, it should just work - but you said "folder", so this could be a Windows issue. The comments suggest a workaround.

    (A rushed reading earlier made me think that trailing slashes were important, but that turned out to be specific to this work around).

提交回复
热议问题