imagesx

(PHP 4, PHP 5, PHP 7, PHP 8)

imagesx取得图像宽度

说明

imagesx(GdImage $image): int

返回指定 image 对象的宽度。

参数

image

由图象创建函数(例如imagecreatetruecolor())返回的 GdImage 对象。

返回值

返回 image 的宽度。

更新日志

版本 说明
8.0.0 image 现在需要 GdImage 实例;之前需要有效的 gd resource

范例

示例 #1 使用 imagesx()

<?php

// create a 300*200 image
$img = imagecreatetruecolor(300, 200);

echo
imagesx($img); // 300

?>

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top