1// Here is a quick way of fetching only the filename (without extension) regardless of what suffix the file has.
2
3// your file
4$file = 'image.jpg';
5$info = pathinfo($file);
6// Before PHP 5.2
7$file_name = basename($file, '.'.$info['extension']);
8// After PHP 5.2
9$file_name = $info['filename'];
1// your file
2$file = 'image.jpg';
3$info = pathinfo($file);
4// Before PHP 5.2
5$file_name = basename($file, '.'.$info['extension']);
6// After PHP 5.2
7$file_name = $info['filename'];