dougal85 wrote:Am i not right in thinking it only needs to cancel double quotes?
Heredoc syntax would also require dollar signs to be escaped.
If I was going to echo a big chunk of arbitrary text it would be as
?>
<html>
<script>
function $(id){
return document.getElementById(id);
}
</script>
</html>
<?php
If I needed to capture that to a variable
ob_start();
?>
<html>
<script>
function $(id){
return document.getElementById(id);
}
</script>
</html>
<?php
$variable = ob_get_clean();
Although in both cases I'd need to properly escape "<?php" if it appears.