- substr: documentation ( source)
- strtolower: documentation ( source)
<?php
$QUERYSTRING = "test.ai";
if( (substr(strtolower($QUERYSTRING), -3) != ".ai") && (substr(strtolower($QUERYSTRING), -4) != ".eps")) {
echo "not allowed";
} else {
echo "allowed";
}