• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP: Strip off multiple extensions from filename

Jay59express

Senior member
Hi, I need to be able to take a filename, say test.tar.gz and rename it to test.tgz. So I would like to be able to strip off the extension(s), check to see if they are .tar.gz, and if they are, create the file test.tgz. Anyone got some code to do this? Tried using the examples under basename at php.net but could not find the right one.
Thanks!
 
Back
Top