|
|
|
|
|
|
|
|
|
Like this code?
Show the author your appreciation.
|
| |
| <?php
class Is_Image
{
function GIF($path)
{
if (image_type_to_extension(intval(@exif_imagetype($path)), false) != 'gif')
{
return false;
}
return true;
}
function JPG($path)
{
if (image_type_to_extension(intval(@exif_imagetype($path)), false) != 'jpeg')
{
return false;
}
return true;
}
function PNG($path)
{
if (image_type_to_extension(intval(@exif_imagetype($path)), false) != 'png')
{
return false;
}
return true;
}
}
?> | |
Usage:
| <?php
var_dump(Is_Image::GIF('path/to/file.gif'));
var_dump(Is_Image::JPG('path/to/file.jpg'));
var_dump(Is_Image::PNG('path/to/file.png'));
?> | | |
|
| Db_lib - practical example usage of database abstraction and form validation.
Categories : PHP, Form Processing, PHP Classes, Data Validation, Beginner Guides | | | Advanced Image WaterMarker Categories : PHP, PHP Classes, GD image library, Graphics, Object Oriented | | | PHP interface class to the eBusiness Charts generatation remote service. Categories : PHP, PHP Classes, Graphics, Charts and Graphs | | | My Box - PHP Class that calculates the volumetric weight of a package.
Categories : PHP, Object Oriented, PHP Classes, Beginner Guides, Payment Gateways | | | Image Generation Class ( PNG Format ) Categories : PHP, GD image library, PHP Classes, Graphics | | | EasyPhpThumbnail Class - The EasyPhpThumbnail class allows you to generate thumbnails and handle image manipulation for GIF, JPG and PNG on-the-fly. Categories : PHP, PHP Classes, Object Oriented, Graphics, GD image library | | | Banknote Validation - A PHP class that provides several methods to quickly validate banknote serial numbers of the following currencies: AUD, CAD, CHF, CNY, EUR, GBP, JPY, USD.
Categories : PHP, PHP Classes, Data Validation, Regexps | | | Find the day of the week for any given year/month/day. Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides | | | Simple image counter Categories : PHP, Graphics, Filesystem, Beginner Guides | | | Ensure that a specific value lies within a specific range. Categories : PHP, Beginner Guides, Data Validation | | | Power Form Validation Categories : PHP, PHP Classes, Data Validation | | | Find if a year is leap. Categories : PHP, Date Time, Beginner Guides, Data Validation | | | Validating a URL with preg_match Categories : PHP, Regexps, Beginner Guides, Data Validation | | | How to display any array in several rows and columns of a table. Not just
in one column or in alternate rows. This example shows a nice color table
generated with PHP, but can be used with any array values(e.g. Database) Categories : Arrays, PHP, Miscellaneous, Beginner Guides, Graphics | | | imageMarker v 3.00 with new advanced features Categories : PHP, PHP Classes, Graphics, GD image library | |
| |
| |
|