循环中的php t_字符串错误
我认为这段代码还可以,但是我收到程序这一部分的错误“Parse error:syntax error,unexpected T_STRING”。谁能告诉我我做错了什么?如果我把风格部分写对了 谢谢循环中的php t_字符串错误,php,loops,input,textbox,Php,Loops,Input,Textbox,我认为这段代码还可以,但是我收到程序这一部分的错误“Parse error:syntax error,unexpected T_STRING”。谁能告诉我我做错了什么?如果我把风格部分写对了 谢谢 } elseif ($answers['answerType'] == "textbox"){ echo ("\n<ul><input type=\"text\" id=\"text-$questionID\" value=\"$answer\" style=
} elseif ($answers['answerType'] == "textbox"){
echo ("\n<ul><input type=\"text\" id=\"text-$questionID\" value=\"$answer\"
style="width:100px; height:40px"; <br /></ul>";
}elseif($answers['answerType']==“textbox”){
echo(“\n您没有转义所有的
”
字符,也没有关闭(
),您可以对其进行操作。请尝试:
echo "\n<ul><input type=\"text\" id=\"text-$questionID\" value=\"$answer\"
style=\"width:100px; height:40px\"; <br /></ul>";
echo”\n您需要添加斜杠,其中包含所有双引号和不需要的括号
试一试
echo“\n您的回音行不正确。您打开了不需要的
(
,并且没有逃逸”
。因此最好使用不同的内部引号或使用herdoc
。请尝试此方法
echo "\n<ul><input type='text' id='text-$questionID' value='$answer' style='width:100px; height:40px'; <br /></ul>";
echo”\n试试这个,您没有正确关闭输入标记,需要包装内联样式
\
<input type=\"text\" id=\"text-$questionID\" value=\"$answer\"
style=\"width:100px; height:40px;\">
---^
---^
考虑添加更多代码。看到条件块的一部分没有初始的if
语句会让人不安。还包括您已经尝试过的任何资源。
<input type=\"text\" id=\"text-$questionID\" value=\"$answer\"
style=\"width:100px; height:40px;\">
---^