Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php regex file extension

$fileName = 'banner.jpg';

$ext = end(explode('.', $fileName));
$ext = substr(strrchr($fileName, '.'), 1);
$ext = substr($fileName, strrpos($fileName, '.') + 1);
$ext = preg_replace('/^.*.([^.]+)$/D', '$1', $fileName);
$ext = pathinfo($fileName, PATHINFO_EXTENSION);
Comment

PREVIOUS NEXT
Code Example
Php :: php needle haystack 
Php :: Laravel Boot strap Pagination 
Php :: wordpress get the product images 
Php :: root directory in php 
Php :: showing php code in browser 
Php :: acf wp_query custom field 
Php :: array_last in laravel 8 
Php :: how to get a particular column in laravel 8 
Php :: create laravel 9 auth 
Php :: How do I check if a string contains a specific word? 
Php :: how to know the path of php in linux 
Php :: Undefined index: HTTP_HOST 
Php :: larave artisan command run in web 
Php :: laravel redirect back url with message 
Php :: linux delete php sessions 
Php :: laravel 8 insert multiple rows 
Php :: laravel 404 
Php :: To perform the requested action, WordPress needs to access your web server. Please enter your FTP 
Php :: target class usercontroller does not exist. in laravel 8 
Php :: Deleting an element from an array in PHP 
Php :: eloquent limit vs take 
Php :: date format change in laravel 
Php :: mpdf output 
Php :: date_sub laravel 7 
Php :: php get client mac address 
Php :: print try catche errors 
Php :: get country from ip 
Php :: execute specific migration laravel 
Php :: carbon equal dates 
Php :: yii2 set cookie 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =