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

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

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