Skip to content

Instantly share code, notes, and snippets.

@aswebdev
Last active August 29, 2015 13:56
Show Gist options
  • Save aswebdev/3f78c8882b2f7944262c to your computer and use it in GitHub Desktop.
Save aswebdev/3f78c8882b2f7944262c to your computer and use it in GitHub Desktop.
Append an append string to a filename
// Append to a filename
function appendToFilename($file,$append) {
return preg_replace('/(\.[^.]+)$/', sprintf('%s$1', $append), $file);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment