«
TG007 News Posting PHP: Delete File If Exists »
There are many ways to get the file extension of a file. Here is an example of a php function I found to do just that.
<?php
function file_extension
($fname)
{
$path_info =
pathinfo($fname);
return $path_info[‘extension’];
}
?>
Another way would be to check the actual string and use what’s after the last slash. I picked this up on a forum I visit.
Leave a Reply