我不知道我在这里做错了什么,但我遇到了解析错误: "解析错误:语法错误,意外的 ',' in..."
$msg= 'This is ', htmlentities($from, ENT_QUOTES, 'UTF-8'),' and ', htmlentities($to, ENT_QUOTES, 'UTF-8'),' dates statistic ';
echo $msg;
你能帮帮我吗?我不想使用串联,因为速度较慢。
最佳答案
基本上逗号分隔值是参数。您正在尝试将参数传递给变量而不是 echo!
echo 'This is ',
htmlentities($from, ENT_QUOTES, 'UTF-8'),
' and ',
htmlentities($to, ENT_QUOTES, 'UTF-8'),
' dates statistic ';
关于php - 尝试使用 echo 的逗号而不是字符串连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7230836/