public function changeFileExt($fileName, $ext = "html") { $pics = explode('.', $fileName); $len = count($pics); if ($len > 1) { $pics[$len - 1] = $ext; } return implode(".", $pics); }