Reputation: 1277
I want to get the file extension of a file however the file name increments so I could have file_01_XX.jpg...how could I get the extension of a file where I don't know the full file name but I know the start of it?
If you could help me that would be great. Many thanks in advance.
Upvotes: 0
Views: 671
Reputation: 382666
You can use pathinfo
function like this:
$parts = pathinfo('your file name');
echo $parts['extension'];
I want to get the file extension of a file however the file name increments so I could have file_01_XX.jpg...how could I get the extension of a file where I don't know the full file name but I know the start of it?
Whatever file name it is, this will give you the extension :)
Upvotes: 1