Php-Get image name and extension

<?php $image = “glass.jpg”; //Getting image name $img_name    = pathinfo($image, PATHINFO_FILENAME); //Getting image extension $img_ext     = pathinfo($image, PATHINFO_EXTENSION); ?>