【问题标题】:Whats wrong with this line of PHP code?这行 PHP 代码有什么问题?
【发布时间】:2014-02-20 05:45:29
【问题描述】:

解析错误:语法错误,意外的 'Pre' (T_STRING),需要 ',' 或 ';'在第 719 行的代码中

719: if (get_the_author_meta('Pre-Rolls') != '0') { echo get_the_author_meta('Pre-Rolls'); }

我没有看到我在哪里缺少 , 或 ;?

不喜欢 Pre-Rolls 中的“-”吗?是这个问题吗?

【问题讨论】:

  • 您可能在该行之前的某处缺少'。
  • 正如@Gumbo 所说,这条线看起来很干净,肯定是它之前的东西
  • 719: 应该在那里吗?
  • ; if (get_the_author_meta('Pre-Rolls') != '0') { echo get_the_author_meta('Pre-Rolls'); } 可能会解决它:)

标签: php runtime-error


【解决方案1】:

这是此行之前的代码的问题。 Unexpected 'Pre' 表示您没有关闭字符串(缺少单引号)。

【讨论】:

  • 谢谢!就是这样。我使用 " 而不是 ' 来关闭一行。
猜你喜欢
  • 1970-01-01
  • 2011-07-07
  • 1970-01-01
  • 1970-01-01
  • 2015-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多