YouTip LogoYouTip

Php Imagesx Imagesy

## PHP Get Image Width Function: imagesx() The imagesx() function is used to get the width of an image in pixels. It returns an integer. ### Syntax: int imagesx( resource image ) The parameter `image` is the image resource returned by functions like imagecreatetruecolor(), imagecreatefromjpeg(), etc. ## PHP Get Image Height Function: imagesy() The imagesy() function is used to get the height of an image. Its syntax and usage are the same as imagesx(). ### Syntax: int imagesy( resource image ) The parameter `image` is the image resource returned by functions like imagecreatetruecolor(), imagecreatefromjpeg(), etc. ## Example <?php $img = imagecreatefrompng("-logo.png"); echo "Image Width: ",imagesx( $img ),"
"; echo "Image Height: ",imagesy( $img );?> Browser Output: Image Width: 290Image Height: 69 ## Related Articles Get Image Information Function: [getimagesize()](#) [![Image 4: PHP Image Processing](#)PHP Image Processing](#)
← Php GetimagesizeCss Rwd Frameworks β†’