Source Code:
(back to article)
<?php $filename = "myfile.txt"; // Get the pathinfo of the file $pathinfo = pathinfo($filename); // Get the filename without the extension $filename_without_extension = basename($filename, '.' . $pathinfo['extension']); echo $filename_without_extension; // Outputs "myfile"
Result:
Report an issue