Echo double quotes inside double quotes issue

依然范特西╮ 提交于 2019-12-11 13:27:14

问题


How is that possible to use double quotes inside PHP echo double quotes? The class "problem" is a problem.

 echo " new function('<span class="problem"></span>');";

回答1:


try like this..

echo "new function('<span class=\"problem\"></span>');";

i hope it will work




回答2:


Try this way

echo <<<END
All the text u wanna echo
u can use double and single quotes
END;


来源:https://stackoverflow.com/questions/50781770/echo-double-quotes-inside-double-quotes-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!