Getting file name for uploaded file from hard drive using PHP basename function?
Posted on 2007-11-20
Using PHP to receive an upload file from a file input form element.
Want to get the filename by using the basename function but the function doesn't work when the path starts with the drive letter (for example, c:\documents\test.txt), it can't get me the test.txt information.
I would try to use the explode function to create an array but the directory system on Macs and PCs are different. Can someone tell me how to get the file name off a mac or PC. Is it possible to use basename?