WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : PHP Image Validation Class - test if a specific file is of a certain image type without relying on the said file extension.
Categories : PHP, PHP Classes, Data Validation, Graphics, Beginner Guides Click here to Update Your Picture
Alix Axel
Date : Apr 28th 2009
Grade : 3 of 5 (graded 2 times)
Viewed : 5829
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Alix Axel
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
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