Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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);
Source by techieroop.com #
 
PREVIOUS NEXT
Tagged: #php #regex #file #extension
ADD COMMENT
Topic
Name
9+9 =