Deleting files with special characters...
Moderator: General Moderators
Deleting files with special characters...
How can I delete files with special characters with PHP? unlink() just gives me an error saying that the file doesn't exist.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: Deleting files with special characters...
windows or linux?
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: Deleting files with special characters...
what characters are you having trouble with?
example?
example?
Re: Deleting files with special characters...
filenames with % ! " $ & : ? ...lots of crazy things...
The script that was being used on the website was saving pages as the title of the pages, so if the title had a ? or anything in it, it showed up in the filename and gave us problems.
2008:%20%22The%20Year%20of%20the%20River%22%20in%20Cedar%20Rapids21%20Jun%202008,%208:05%20am.php
The script that was being used on the website was saving pages as the title of the pages, so if the title had a ? or anything in it, it showed up in the filename and gave us problems.
2008:%20%22The%20Year%20of%20the%20River%22%20in%20Cedar%20Rapids21%20Jun%202008,%208:05%20am.php
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: Deleting files with special characters...
out on a limb here, but maybe escapeshellarg() would do the trick?