How to get filename without extension in PHP?By Hardik Savani | May 26, 2016 | | 583 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);
- JQuery - Display loading image on ajax call example
- How to get current month records in Laravel 5?
- How to get last executed mysql query in laravel ?
- How to get url segment in Laravel 5?
- Laravel 5.3 - Customize pagination templates example from scratch
- Solve - Installation request for guzzle/guzzle in laravel
- How to check request is Ajax or not in Laravel 5?
- Simple Add remove input fields dynamically using jquery with Bootstrap