$file = 'mydocument.docx'; $ext = JFile::getExt($file); echo $ext; // output: docxIn this example, the getExt() method is used to extract the extension of a file named "mydocument.docx". The output of the code will be "docx". Package library: Joomla! CMS