php - check whether string end with image extension
I need to verify string whether the string is image file name.
$aaa = 'abskwlfd.png';
if ($aaa is image file) {
echo 'it's image';
else {
echo 'not image';
}
How do i do that? It will chck 100 images, so it should be fast. I know
there is a filetype verification method, but I think that's slow.. What
about preg_match? Is it faster? I'm not good at preg_match.
Thank you in advance.
No comments:
Post a Comment