开发者

PHP pase error - imagecreatetruecolor

$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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜