advanced code snippet search
petrafull on 11/08/09
php extension
11/08/09 12:49pm
$image_name = substr(filename, 0 , -4);
Report this snippet Tweet
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
Comment:
You need to login to post a comment.
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