Snippet shows you how to get filename from a path in PHP. Filename and extension separately. Can be used for extending filenames with timestamp or anything.
Source code viewer
// Filename and extension separately, useful for extending filenames. echo $bg['filename'] . '.' . $bg['extension']; // Full filename. echo $bg['basename']; Programming Language: PHP