php - Get the file extension -


i'm exploding on "." file format , name:

list($txt, $ext) = explode(".", $name); 

the problem files have names dots.

how explote on last "." $name=pic.n2 , $ext=jpg from: pic.n2.jpg?

use pathinfo:

$pi = pathinfo($name); $txt = $pi['filename']; $ext = $pi['extension']; 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -