drm16022 2011-08-14 13:17 采纳率: 0%
浏览 127
已采纳

PHP解析错误 - 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, $transparent) or return false;

  • 写回答

1条回答 默认 最新

  • dounabi6295 2011-08-14 13:21
    关注

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

    if (!$img = @imagecreatetruecolor(32, 32)) {
       return false;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?