PHP | imagesx() Function Last Updated : 23 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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 creation function. Return Value: This function returns the width of the image or FALSE on errors. Below programs illustrate the imagesx() function in PHP. Program 1: php <?php // store the image in variable. $image = imagecreatefrompng("gfg.png"); // Display the width of image. echo imagesx($image); ?> Output: 667 Program 2: php <?php // Create the size of image or blank image. $image = imagecreatetruecolor(500, 300); // Display the width of image. echo imagesx($image); ?> Output: 500 Related Articles: PHP | imagedashedline() Function PHP | imagecolorat() function PHP | imagepolygon() Function Reference: http://php.net/manual/en/function.imagesx.php Comment More infoAdvertise with us Next Article PHP | imagesx() Function V vijay_raj Follow Improve Article Tags : Misc Web Technologies PHP PHP-function Practice Tags : Misc Similar Reads 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 PHP | imagexbm() Function The imagexbm() function is an inbuilt function in PHP which is used to display image to browser a file. The main use of this function is to view an image in the browser and convert any other image type to XBM. Syntax: bool imagexbm( resource $image, int $to, int $foreground) Parameters: This functio 2 min read PHP | imagegd() function The imagegd() function is an inbuilt function in PHP which is used to output GD image to browser or file. This is most useful to convert any other image type to gd. imagecreatefromgd() function can be used to further read gd images. Syntax: bool imagegd( resource $image, float $to) Parameters:This 2 min read PHP | imagepng() Function The imagepng() 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 PNG and applying filters to the image. Syntax: bool imagepng( resource $image, int $to, int $qual 2 min read PHP | imagetypes() Function 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 t 1 min read Like