I currently am trying to echo the contents of a text file within JavaScript. Everything works but there is a problem. The text within the text contains apostrophes, which is throwing everything off. Below is a portion of the code that I am using. I am using this code for MANY text files. I have considered changing each apostrophe to "\'" in each text file, but there are a lot of text files to deal with. I was just curious if there was another way to work around this. Any ideas are greatly appreciated.
<?php
$lyrics = file_get_contents('Includes/Songs/Lose_My_Mind.txt');
?>
JavaScript snippet:
var scrollercontent='<?php echo $lyrics; ?>'