方法1:
function get_file_type($filename){ $type = substr($filename, strrpos($filename, ".")+1); return $type; }
方法2:
function get_file_type($filename) { $type = pathinfo($filename); $type = strtolower($type["extension"]); return $type; }
方法3:
function get_file_type($filename) { $type =explode("." , $filename); $count=count($type)-1; return $type[$count]; }
希望本文所述对大家的php程序设计有所帮助。
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群