开发者

How do I use inverted commas in the echo function in PHP?

开发者 https://www.devze.com 2022-12-31 14:23 出处:网络
How do I use inverted commas in the echo function i开发者_Go百科n PHP? echo \"<script type=\"text/javascript\">\";

How do I use inverted commas in the echo function i开发者_Go百科n PHP?

echo "<script type="text/javascript">";

doesnt work well.

Thank you!


Escape them with backslashes:

echo "<script type=\"text/javascript\">";

Alternatively, you can use a different set of quotes:

echo '<script type="text/javascript">';

Or, HEREDOC syntax:

echo <<<END
<script type="text/javascript">;
END;


echo "<script type=\"text/javascript\">";
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号