我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

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;

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

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

近期文章

  • 目标c和php中的密码AES模式ECB [重复]
  • Lighttpd在服务的html文件中转义<?php?>?
  • 按顺序在iframe中重新加载2个php页面
  • 使用PHP json_encode了解JSON响应
  • 不确定为什么jQuery没有获取变量信息
  • Wordpress无法识别正确的PHP版本以进行更新
  • 比较/评估mysql中的两个子查询
  • 与Zend_Log_Writer_Firebug一起使用时,FirePHP不显示额外内容
  • 创建排行榜,我将如何显示排名/位置?
  • PHP循环为循环中的每个项目提供相同的结果
  • 从图像目录创建多个HTML文件
  • 如何在php数组中搜索(匹配)多个值?
  • PHP,Apache,Mysql,HTML5 - 从服务器获取更改而不请求它们(推送)
  • PHP MySQL连接错误
  • 架构:多个网站。 一个代码库。 自定义代码
  • 使用Zend_Db_Adapter创建数据库
  • 想要暂停AJAX,显示2s的进度条然后继续
  • 为什么这个AJAX调用正确的php脚本没有返回任何东西?
  • 有没有办法让Apache / PHP日志专门为什么要返回500?
  • 无法打开流:HTTP请求失败! 需要HTTP / 1.1 407代理身份验证(ISA Server需要授权才能完成请求

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华