开发者

Unexpected T_ECHO warning? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit开发者_运维知识库 the help center. Closed 9 years ago.

I get a UNexpected T_ECHO warning when I add the following line:

<div id="counter"><?php (function_exists('fbshare_manual')) echo fbshare_manual(); ?></div>

I'm not sure what's a T_ECHO and what's the problem. Any suggestions?


You seem to be missing an if.

<div id="counter"><?php if (function_exists('fbshare_manual')) echo fbshare_manual(); ?></div>

Explanation: T_ECHO stands for the "echo" keyword. "Unexpected T_ECHO" means that word was somewhere it shouldn't be. (Absent the if, PHP would consider the stuff in parens and the echo as two separate statements, and would expect a semicolon or something between the two.)


I think you need an if after that opening php tag.

<div id="counter"><?php (function_exists('fbshare_manual')) echo fbshare_manual(); ?></div>
                       ^-- Insert "if"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜