Hello Friends,
Today we will discuss how to get a filename without extension in Joomla. In Joomla, stripExt() function is used for this purpose. It will return the name of the file without extension.
Syntax:
$name = JFile::stripExt($filename);
In above syntax, JFile is the name of the class in which stripExt() function is defined. $filename is the name of the file whose name we required.
Let's take an example to understand this function.
<?php
$filename="component.php";
$name = JFile::stripExt($filename);
echo $name;
?>
The above example returns the following output:
component
0 Comment(s)