advanced code snippet search
petrafull on 11/08/09
$image_name = substr(filename, 0 , -4);
Report this snippet
Posting things like this indicates you should be spending more time on php.net as a function for this already exists:
print pathinfo($filepath, PATHINFO_FILENAME);
Also it should be noted that assuming all file extensions are 3 characters long is poor practice.
example: .jpeg, .ai, .docx
You need to login to post a comment.