WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
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 Index
Web Development Resources
Web Development Content
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
Mobile Dev World
Get file extension for image type

image_type_to_extension

(PHP 5)

image_type_to_extensionGet file extension for image type

Description

string image_type_to_extension ( int $imagetype [, bool $include_dot ] )

Returns the extension for the given IMAGETYPE_XXX constant.

Parameters

imagetype

One of the IMAGETYPE_XXX constant.

include_dot

Whether to prepend a dot to the extension or not. Default to TRUE.

Return Values

A string with the extension corresponding to the given image type.

Examples

Example #1 image_type_to_extension() example

<?php
// Create image instance
$im imagecreatetruecolor(100100);

// Save image
imagepng($im'./test' image_type_to_extension(IMAGETYPE_PNG));
imagedestroy($im);
?>

Notes

Note: This function does not require the GD image library.


how to make an image reset a form (instead of using the conventional reset button type).
Categories : Java Script
This class allows you to upload files using your broswer. It checks file type, image type, file size, image height and width, and more.
Categories : PHP, PHP Classes
Get the correct extension and MIME types of an image, even when the filename is incorrect.
Categories : PHP, Filesystem, General SQL



How to know which input button of type image was pressed in a form with multiple image buttons (_x and _y) in PHP?
Categories : PHP, Variables, HTML
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
Class for processing image (resizing the image size to create thumb nails and small images from actual image without loosing the aspect ratio of the image)
Categories : PHP, PHP Classes, Graphics
Building a basic error handler with custom error types
Categories : PHP, PHP Classes, Errors and Logging
How can i add mime types to IIS 3.0 and IIS 4.0?
Categories : IIS, WinNT, Web Servers
Format US phone number version 2. Rewritten to have an invalid statement output, and to include a extension number, up to four digets.
Categories : PHP, Regexps
How to show images stored in a database
Categories : PHP, MySQL, Databases
Directory cleanup - This script was created for those times when you've allowed a directory to be overloaded with temp or cache type files which all need to be deleted.
Categories : PHP, Filesystem
Encrypt/Decrypt string with a given key by using mcrypt module of PHP (suitable to store encrypted data into any type of databases).
Categories : PHP, Encryption
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
The title "AdRotator" has say that. It's a advertisement bar rotator routine using a .INI like file to store your ADs. Just pass some parameters to the function to create a customizied privilege/random display, text/image advertisement bar
Categories : PHP