<?php $a = 'лалала123.PHP'; if(strpos($a,'.php') or strpos($a,'.phtml')) die('error'); else echo 'УРА!!!' ; ?>