Parse error: parse error, unexpected $end,大家帮忙解决,在线等...

hbuxiaoshe 2006-06-04 08:33:48
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<?
$str="襖";
echo $str;
?>
</body>
</html>
这是源代码
错误为:
Parse error: parse error, unexpected $end in d:\usr\www\html\string\bb.php on line 14

请问:
(1)那里错了?
(2)这是什么错误?
(3)如何才能改正错误?

谢谢!
...全文
351 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
iasky 2007-04-26
  • 打赏
  • 举报
回复
襖这个字是什么编码的?
swazn_yj 2007-04-26
  • 打赏
  • 举报
回复
PHP Parse Error: syntax error, unexpected $end 解决方法2007-02-09 11:12In PHP 5, the following error may appears as an error entry in Apache error log or simply displays on PHP web page, even if calling to php scripts with php_info() works perfectly and successfully returns information on PHP configurations:

Parse Error: syntax error, unexpected $end in ….. scripts.php on line …

The error may caused by a missing curly bracket in PHP script coding. Beside, it may also caused by error in PHP coding in class definition, as in PHP, a class definition cannot be broke up and distributed into multiple files, or into multiple PHP blocks, unless the break is within a method declaration.

But more commonly, the error is often caused by the use of Short Open tags in PHP,

To use short open tags, it must be enabled in PHP.INI. Search for short_open_tag in PHP.INI, and change the value to On. The line should look line:

short_open_tag = On
hbuxiaoshe 2006-06-04
  • 打赏
  • 举报
回复
谢谢,不过这样的话,这个串的长度就+1了
要想与其他串比较的话,其他串也得在最后面加空格
不过,还可以接受,是个办法
mrshelly 2006-06-04
  • 打赏
  • 举报
回复
$str="襖 "; //后面加个空格就行了。

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧