开发者

How can you create a folder with PHP with special/wildcard characters?

开发者 https://www.devze.com 2023-03-29 16:38 出处:网络
I guess I have two quest开发者_Python百科ions actually: One: How do I create folders with special/wildcard characters? (e.g. !@#$%^&*)

I guess I have two quest开发者_Python百科ions actually:

One: How do I create folders with special/wildcard characters? (e.g. !@#$%^&*)

Two: How can I remove a folder created with those characters? I have two on my server and am using FTP and trying to remove them but they aren't being deleted.

I tried to rename them but Filezilla returns 550 234f @$%^: Forbidden command argument. How can I remove them?


Use escapeshellcmd() for escaping and or quoting. IF you want to execute the command on the console, single quotes usually do:

rmdir '550 234f @$%^'

If you can perform it from within PHP (if permissions are sufficient), then just use rmdir() as that passes the raw filename along to the operating system:

rmdir('550 234f @$%^');

In FTP clients the quoting or escaping might not always work; there's some variance in FTP server implementations.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号