An easy way to get the extension of a file with php.
The result will be 'jpg'.
$src = 'myname.jpg';
$arr = explode('.',$src);
$extension = $arr[count($arr)-1];
$echo $extension;
The result will be 'jpg'.
Comments
Post a Comment