$ext = explode('.', $image_name); $file_name = $ext[0]; $file_ext = $ext[1]; $new_file = $file_name . '_' . time() . '.' . $file_ext; //time() returns unix format