Temukan Ekstensi File - Trik CSS

Anonim

Metode 1

function findexts ($filename) ( $filename = strtolower($filename) ; $exts = split("(/\\.)", $filename) ; $n = count($exts)-1; $exts = $exts($n); return $exts; )

Metode 2

$filename = 'mypic.gif'; $ext = pathinfo($filename, PATHINFO_EXTENSION);

Metode 3

function getFileextension($file) ( return end(explode(".", $file)); )