PHP | imagesy()函数

这个 imagesy() 函数是PHP中的一个内置函数,用于返回给定图像的高度。

null

语法:

int imagesy( $image )

参数: 此函数接受单个参数 $image 这是强制性的。这个 $image 变量存储ImageCreateTureColor()图像创建函数创建的图像。

返回值: 此函数用于返回图像的高度或错误时返回FALSE。

下面的程序说明了 imagesy() 函数。

项目1:

<?php
// store the image in variable.
$image = imagecreatefrompng( "gfg.png" );
// Display the height of image.
echo imagesy( $image );
?>


输出:

184

项目2:

<?php
// Create the size of image or blank image.
$image = imagecreatetruecolor(500, 300);
// Display the height of image.
echo imagesy( $image );
?>


输出:

300

相关文章:

参考: http://php.net/manual/en/function.imagesy.php

© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享