Handling filenames with spaces in PHP
I have some PHP pages that worked fine using a Windows based HTTP server (specifically OpenSA - Apache). I have since moved those pages to a Mandrake 9.2 system. The problem is that referencing filenames with imbedded spaces worked fine under Windows. However, in Unix those imbedded spaces cause errors. I can use quotes (") on the command line to access those filenames but that doesn't seem to work with the Mandrake version of PHP.
For example, what would be the corrrect syntax of:
if (file_exists($dirname."/".$filename.".txt")) {
if both of the strings in $dirname and $filename contain spaces?
I tried this to no avail:
if (file_exists("\"".$dirname."/".$filename.".txt"."\"")) {
TIA.
|