1//get image extension of uploaded file in php
2$imagetype = $_FILES['image']['name'];
3$ext = pathinfo($imagetype, PATHINFO_EXTENSION);// get file extension
1<?php
2echo filetype('/etc/passwd'); // file
3echo filetype('/etc/'); // dir
4?>
5
6