php get file extension from filename
snippet in php

php get file extension from filename

user1597

$ext = pathinfo($filename, PATHINFO_EXTENSION);

get extension from filename php

Noob codes official

$path = "/home/ali/public_html/wp-content/themes/chicken/css/base.min.css";
$name = pathinfo($path, PATHINFO_FILENAME);
$ext  = pathinfo($path, PATHINFO_EXTENSION);
printf('<hr> Name: %s <br> Extension: %s', $name, $ext);