English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The imagesx() function is used to get the width of the image, in pixels, and the return value is an integer.
int imagesx(resource image)
The parameter image is a resource returned by functions such as imagecreatetruecolor(), imagecreatefromjpeg(), etc.
The imagesy() function is used to get the height of the image, the syntax and usage are the same as imagesx().
int imagesy(resource image)
The parameter image is a resource returned by functions such as imagecreatetruecolor(), imagecreatefromjpeg(), etc.
<?php $img = imagecreatefrompng("w3codebox-logo.png"); echo "Image Width:", imagesx($img),"<br />"; echo "Image Height:", imagesy($img); ?>
Browser Output:
Image Width:290 Image Height:69
Image Information Function:getimagesize()