How to get filename without extension in PHP?By Hardik Savani | May 26, 2016 | | 506 Viewer | Category : PHP
Share this post:
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);
- Laravel 5 File(Image) Upload Example with Validation
- Jquery notification popup box example using toastr JS plugin with demo
- How to get current route name in Laravel 5?
- Bootstrap SweetAlert - Confirm dialog box model with yes and no option example
- How to get last inserted id in laravel 5?
- How to solve 'There are no commands defined in the "cashier" namespace' in Laravel 5
- Laravel 5.2 and AngularJS CRUD with Search and Pagination Example.
- Jquery highlight search text in div using highlight JS with example