我想检查IF中三个函数中的任何一个是否没有成功执行。如果他们中的任何一个没有运行,我想要返回值为false。关于PHP函数返回的问题
if($ext == "gif" or $ext == "png"){
imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));
imagealphablending($new, false);
imagesavealpha($new, true);
}
例如,我想知道是否所有的三个功能了imagecolortransparent,imagealphablending,imagesavealpha没有成功执行,如果没有,返回false。 我需要检查每个功能,如下或有更好的方法?
if($ext == "gif" or $ext == "png"){
if ([email protected]($new, imagecolorallocatealpha($new, 0, 0, 0, 127)))
return false;
if ([email protected]($new, false))
return false;
if ([email protected]($new, true))
return false;
}
谢谢。
什么是__better__? – gnur
我只是想知道如果我需要为每个函数返回false,因为在我的图像调整大小函数im使用许多内置的图像相关函数,所以我必须单独返回每个函数返回值。 – sunjie