how to check valid extension in php