PHP | imagetypes() Function Last Updated : 26 Jul, 2019 Comments Improve Suggest changes Like Article Like Report The imagetypes() function is an inbuilt function in PHP which is used to return the image types supported by the PHP inbuilt installed library. Syntax: int imagetypes( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the bit-field corresponding to the image formats supported by the version of GD linked into PHP. This function returns the following bits: IMG_BMP, IMG_GIF, IMG_JPG, IMG_PNG, IMG_WBMP, IMG_XPM, IMG_WEBP. Below programs illustrate the imagetypes() function in PHP: Program 1: php <?php if (imagetypes() & IMG_PNG) { echo "PNG Support is enabled"; } else { echo "Not supported image type."; } ?> Output: PNG Support is enabled Program 2: php <?php if (imagetypes() & IMG_JPEG) { echo "JPEG Support is enabled"; } else { echo "Not supported image type."; } ?> Output: JPEG Support is enabled Related Articles: PHP | imagegif() Function PHP | imagecolorexact() Function Reference: http://php.net/manual/en/function.imagetypes.php Comment More infoAdvertise with us Next Article PHP | imagetypes() Function V vijay_raj Follow Improve Article Tags : Misc Web Technologies PHP Image-Processing PHP-function +1 More Practice Tags : Misc Similar Reads PHP | imagejpeg() Function The imagejpeg() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser, convert any other image type to JPEG and altering the quality of the image. Syntax: bool imagejpeg( resource $image, int $to, in 2 min read PHP | exif_imagetype() function The exif_imagetype() function is an inbuilt function in PHP which is used to determine the type of an image.Syntax:Â Â int exif_imagetype( string $filename ) Parameters:This function accepts a single parameter $filename which holds the name or URL of the image.Return Value: This function returns an i 1 min read PHP gettype() Function The PHP gettype() function returns the type of a variable as a string. It identifies the variable's data type, such as string, integer, array, boolean, etc., allowing developers to check and handle different data types dynamically.Syntax:string gettype ( $var )Parameter: This function accepts a sing 2 min read PHP | imagesx() Function The imagesx() function is an inbuilt function in PHP which is used to return the width of the given image. Syntax: int imagesx( $image ) Parameters: This function accepts single parameters $image which is mandatory. This $image variable can store the image created by imagecreatetruecolor() image cre 1 min read PHP | imagesy() Function The imagesy() function is an inbuilt function in PHP which is used to return the height of the given image. Syntax: int imagesy( $image ) Parameters: This function accepts single parameters $image which is mandatory. This $image variable store the image created by imagecreatetruecolor() image creati 1 min read Like