How do I use inverted commas in the echo function in 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\">";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With