imagesx
PHP function
Edit on GitHub ✎
(PHP 4, PHP 5, PHP 7, PHP 8)
Get image width
Description
imagesx(GdImage $image): int
Returns the width of the given image object.
Parameters
Return Values
Return the width of the image.
Changelog
| Version | Description |
|---|
Examples
Using imagesx()
php
<?php
// create a 300*200 image
$img = imagecreatetruecolor(300, 200);
echo imagesx($img); // 300
?>