Tidy get file name code

Use PATHINFO_FILENAME option rather than 2 lines.