I have a variable in php
$test = "This is a string
It has multiple lines
there are three total" ;
(Output from a text area)
I want to pass this variable to a javascript function
I have write this in my php file
<?php echo "<script language=javascript>convert('$test');</script>"; ?>
but this makes an error "Unterminated string literal" How can i solve this issue ??
<?php echo "<script language=\"javascript\">convert('$test');</script>"; ?><script type="text/javascript">to be precise