How can you create a folder with PHP with special/wildcard characters?
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.
精彩评论