Re: file_Exists() and case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stan wrote:
If $basePicture = "../pictures/2008 west coast trip/2008-06-10 first week at
Chris'/DSC_0011.jpg"
and the file actually is "../pictures/2008 west coast trip/2008-06-10 first
week at Chris'/DSC_0011.JPG"
(uppercase extension) the following snippet of code
----------------------------------------------------------------------------
-----------------------
/* make sure the picture file actually exists */
if(!file_Exists($basePicture))
 {
 echo "file = '" . $basePicture . "' doesn't exist.<br>\n";
 $extStartsAt = strrpos($basePicture, ".") + 1;
 $extOfBasePicture = substr($basePicture, $extStartsAt);
 $basePicture =
substr_replace($extOfBasePicture,strtoupper($extOfBasePicture),$extStartsAt)
;
 }
else
 {
 echo "file = \"" . $basePicture . "\" exists.<br>\n";
 }
----------------------------------------------------------------------------
-----------------------
generates
----------------------------------------------------------------------------
-----------------------
file = "../pictures/2008 west coast trip/2008-06-10 first week at
Chris'/DSC_0011.jpg" exists.
----------------------------------------------------------------------------
-----------------------
The script is running on an UBUNTU v8.04 LAMP server.  Case is supposed to
matter, isn't it?

Thanks,
Stan
Yes, case matters, but only of the file name, not the extension (I think). The extension is simply a secondary file-type identifier.

.jpg = .JPG = .jPg

I could be wrong.

- Craige


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux