I'm trying to fix a picture upload.
But I have some troubles with the check if the file is a picture.
Before I used eregi_replace
but that function is deprecated and now I'm wondering is there possible to use preg_match
and check in an array for a match or how should I do this?
$name = "Picture.jpg";
$picture = array("/^JPG/", "/^PNG/", "/^GIF/", "/^gif/", "/^png/", "/^jpg/", "/^JPEG/", "/^jpeg/");
$something = preg_match($picture, $name, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($something);
Like that or something? I dont have a clue, hope you can help me!