Jump to content

[SOLVED] Using readir and only store jpg in array


ifubad

Recommended Posts

You could, but it would probably be easier to just check the last 4 characters to see if they equal '.jpg'

 

if (str_to_lower(substr($filename, -4))=='.jpg') {
    echo "It's a jpeg!";
} else {
    echo "It's NOT a jpeg.";
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.