imagedestroy

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

imagedestroy销毁图像

说明

imagedestroy(GdImage $image): bool

注意:

此函数无效。在 PHP 8.0.0 之前,用于关闭资源。

在 PHP 8.0.0 之前,imagedestroy() 释放与图像 image 关联的所有内存。

参数

image

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

返回值

成功时返回 true, 或者在失败时返回 false

更新日志

版本 说明
8.0.0 此函数现在是 NOP(空操作)
8.0.0 image 现在需要 GdImage 实例;之前需要有效的 gd resource

范例

示例 #1 PHP 8.0.0 前使用 imagedestroy()

<?php
// create a 100 x 100 image
$im = imagecreatetruecolor(100, 100);

// alter or save the image

// frees image from memory
imagedestroy($im);
?>

add a note

User Contributed Notes

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