开发者

PHP pase error - imagecreatetruecolor

开发者 https://www.devze.com 2023-03-28 13:27 出处:网络
$img = @imagecreatetruecolor(32, 32) or return false; Why doesn\'t this work? I get a parse error, but the code looks ok?

$img = @imagecreatetruecolor(32, 32) or return false;

Why doesn't this work?

I get a parse error, but the code looks ok?

The same with this:

imagefill($img, 0, 0, $tra开发者_StackOverflow中文版nsparent) or return false;


You can't use return like this. You must use an if statement instead:

if (!$img = @imagecreatetruecolor(32, 32)) {
   return false;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消