Javascript broke with multiple line variables from PHP

Error message

Deprecated function: Function create_function() is deprecated in GeSHi->_optimize_regexp_list_tokens_to_string() (line 4698 of /home/digipiph/public_html/sites/all/libraries/geshi/geshi.php).

I have several sites where I use a pop up table to display information if the user rolls over and image.

Example, if the user wants to view notes on a certain client, they can roll over a little "note" image to view the notes about the client pulled from a SQL database.

The code I use for a message may be:

<script type="text/javascript">
note[0] = new Array("","<?php echo $message; ?>;");
</script>

That would work if $message was all one line. But as with all notes fields, you can never determine when the person entering data hits "Enter". If the person did hit enter, your javascript would be broke and it would look like this in the source code.

<script type="text/javascript">
note[0] = new Array("","This is the start of the note field. I hit enter after this sentence twice.
 
Then I started typing again");
</script>

This broke the Javascript. To fix this you can just swap the hidden special characters with a html line break.

Working code:

<script type="text/javascript">
note[0] = new Array("","<?php echo str_replace("\r\n","<br>;", $message); ?>;");
</script>

This would return:

<script type="text/javascript">
note[0] = new Array("","This is the start of the note field. I hit enter after this sentence twice<br><br>Then I started typing again");
</script>