- end: documentation ( source)
- explode: documentation ( source)
- in_array: documentation ( source)
<?php
$allowedExts = array("jpg", "jpeg", "gif", "png");
$extension = end(explode(".", "bleh.blah"));
if(in_array($extension, $allowedExts)){
// your code here
}