How to get filename without extension in PHP?By Hardik Savani | May 26, 2016 | | 2148 Viewer | Category : 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:
$imagePath = "/home/hd/html/test.jpg";
$ext = pathinfo($imagePath, PATHINFO_EXTENSION);
$file = basename($imagePath,".".$ext);
- How to remove undefined value from jquery array?
- Laravel 5 - Full Text Search Example using Scout and Algolia Packages
- Order by using multiple columns and manually array field in Laravel?
- How to create REST API in Laravel 5 ?
- GROUP_CONCAT with different SEPARATOR in laravel Example
- Laravel 5 amazon s3 file upload tutorial - Part 2
- Magento 2 - How to solve one or more indexers are invalid by command line?
- PHP AngularJS CRUD with Search and Pagination Example From Scratch