How to get filename without extension in PHP?By Hardik Savani | May 26, 2016 | | 674 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);
- How to change app version code in Ionic framework
- How to get table name from model in Laravel 5?
- How to add tooltip Bootstrap?
- How to check if file exists or not in Laravel 5?
- How to add mysql trigger from migrations in Laravel 5?
- Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 1
- Bootstrap - Jquery multiple select with checkboxes example using bootstrap-multiselect.js plugin
- How to implement Email Verification with Activation Code example from Scratch in Laravel 5.2 ?