How to get filename without extension in PHP?
If you need to get just filename from url withour file extension then you can get that using basename() php function. In bellow example i give you how to get image name without extension. first we need to get extension of given filename url and then basename() through we can remove that extension like as i did bellow:
Example:
$imagePath = "/home/hd/html/test.jpg";
$ext = pathinfo($imagePath, PATHINFO_EXTENSION);
$file = basename($imagePath,".".$ext);
print_r($file);

Hardik Savani
I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.