src/Utilities/Miscellaneous.php
public static function includeFileExtension($fileName, $extension)
    {
        $fileExtension = self::getFileExtension($fileName, true);

        /*
         * File has given extension?
         * Nothing to do
         */
        if ($fileExtension === strtolower($extension)) {
            return $fileName;
        }

        return sprintf('%s.%s', $fileName, $extension);
    }
public static function includeFileExtension($fileName, $extension)
    {
        $fileExtension = self::getFileExtension($fileName, true);

        /*
         * File has given extension?
         * Nothing to do
         */
        if ($fileExtension === strtolower($extension)) {
            return $fileName;
        }

        return sprintf('%s.%s', $fileName, $extension);
    }
public static function includeFileExtension ( $ fileName , $ extension ) { $ fileExtension = self :: getFileExtension ( $ fileName , true ) ; /*
         * File has given extension?
         * Nothing to do
         */ if ( $ fileExtension === strtolower ( $ extension ) ) { return $ fileName ; } return sprintf ( '%s.%s' , $ fileName , $ extension ) ; }
Returns name of file with given extension after verification if it contains the extension

@param string $fileName  The file name to verify
@param string $extension The extension to verify and include
@return string
Returns name of file with given extension after verification if it contains the extension