取得副檔名

$source_file_ext = pathinfo($_FILES[“files”][“name”], PATHINFO_EXTENSION);

function get_file_name($real_file_name="",$cfsn="") {
  $f=explode(".",$real_file_name);
  $ln=sizeof($f)-1;
  $sub=$f[$ln];
  if($sub=="php")$real_file_name.="s";
        $uploadfile="{$cfsn}_{$real_file_name}";
        return $uploadfile;
}