|
|
|
|
|
One way to go about this is to use a regular expression :
If $file is the name of your file do:
<?
echo eregi("\.(gif)$",$file)?"File is a gif\n":(eregi("\.(jpe?g)$",$file)?"File is a jpeg\n":"File is
neither gif nor jpeg\n");
?>
A second option is to use the getimagesize() function. It returns an array containing the
image size, image type, and some other stuff
berber |
|
| PHP Email image generator - hide your email from bots - using the GD Library Categories : PHP, Graphics, GD image library, Beginner Guides | | | PHP Domain Availability Checker Categories : PHP, Complete Programs, Regexps, HTTP, Sockets | | | Diffusion-Limited Aggregation visualization Categories : PHP, Graphics, Algorithms, Math. | | | img_upload - array img_upload(string 'form field name', string 'image name', string 'destination');
Returns an array with 2 elements.
Index 0 contains the string name of the image.
Index 1 contains the string path to the image. Categories : Graphics, PHP | | | How to create charts for php using Rchart Categories : PHP, Java, JSP, Graphics, Charts and Graphs | | | Annual Bar Chart Categories : Graphics, PHP, Charts and Graphs | | | This script is a contact form between users of a
website (kinda like the PM function on the forums)
Categories : PHP, Databases, MySQL, Regexps | | | Random Image Display Categories : PHP, Filesystem, Graphics, HTML and PHP | | | ereg -- Regular expression match Categories : PHP, PHP Functions, Regexps | | | Create images on fly using GD-Image Lib Categories : PHP, Graphics | | | This is a script that list all image files on a given directory, and displays
the thumbnails nicely formated within an HTML table. It also make use of
JavScript to open pop up windows when the users want to see the full photo. Categories : Graphics, PHP, Complete Programs, Java Script | | | a simple pie-chart in php3 (with gd) Categories : PHP, Graphics, GD image library, Charts and Graphs | | | Advanced Image WaterMarker Categories : PHP, PHP Classes, GD image library, Graphics, Object Oriented | | | making links from text Categories : PHP, Regexps, Email | | | Parse html (title :: meta) Categories : PHP, HTML and PHP, Regexps | |
| |
| |
|