How to get filename without extension in PHP?By Hardik Savani | May 26, 2016 | | 2728 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 implement flash messages in PHP Codeigniter?
- How to change date format in jquery using moment JS ?
- How to check file size when select multiple file validation using Jquery?
- Laravel 5 database backup using Laravel Backup Package
- Laravel 5.3 - import export csv and excel file into database
- Laravel 5 Autocomplete using Bootstrap Typeahead JS Example with Demo
- Laravel 5 - like query example using eloquent where clause.
- Group by year month example in Laravel 5 using Query Builder