Home > Backend Development > PHP Tutorial > PHP语法异常,大神们都进来看看小弟我错哪了

PHP语法异常,大神们都进来看看小弟我错哪了

WBOY
Release: 2016-06-13 10:29:24
Original
984 people have browsed it

PHP语法错误,大神们都进来看看我哪里错了!
我的代码:

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    
Copy after login

账号:

密码:


放到服务器上提示:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\index.php on line 16
上面第一行代码就是第16行

------解决方案--------------------
echo"

当前时间是:$currtimestr

"


账号:


密码:





php?>
1. echo 最好和 ""分开 
echo "内容";
2. 内容要被引号包裹,而你要输出的HTML代码中有双引号,PHP解释器是依靠引号来判断字符串在哪里结束的,因此
3. PHP代码段的结束标志是 ?> 不是 php?> 只有开始是 正确的代码:
$currtime=time();
$currtimestr=strftime("%H:%M:%S",$currtime);
echo '

当前时间是:'. 
$currtimestr. 
'

"


账号:


密码:



';

?>

------解决方案--------------------
探讨

我把所有""重新输入也是报错啊
还有16行就是

账号:


密码:




html;
当然,我没有看你其他的代码,只是这个部分...

探讨

引用:

我把所有""重新输入也是报错啊
还有16行就是
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template