Hello friends,
Today we will discuss how to get file extension in Joomla. In Joomla, getExt() function is used for this purpose.
Syntax:
$ext = JFile::getExt($filename);
JFile is the name of the class in which getExit method is defined. $filename is the name of the file whose extension we need to find out.
Let's take an example to understand the function.
<?php
$filename="component.php";
$ext = JFile::getExt($filename);
echo $ext;
?>
In above example we have taken a file component.php whose extension we need to find out. It will return the php as output.
0 Comment(s)