HTML Text dumped to JavaScript array breaks my code
I'm trying to dump a PHP array to a JavaScript one. (without using any extra extensions)
So far I've managed to make it dump the ID and titles of the text items it retrieves from the database but as soon as I try to dump the text item content the whole script breaks.

    <script type="text/javascript">
	var idList=new Array();
	var titleList=new Array();
	var contentList=new Array();
	<?php
	foreach($list["id"] as $index => $value)
	{
		$content = htmlentities($list["tekst"][$index], ENT_QUOTES);
		echo('idList.push('.$list["id"][$index].');');
		echo('titleList.push("'.$list["title"][$index].'");');
		//echo('contentList.push("'.$content.'");');
	}
	?>
	</script>
The line that breaks the whole script has been commented out.
Here's one of the strings that is pushed to contentList:

    &lt;p&gt;Ik ben onweer. ROMMELDEBOMMEL!&lt;/p&gt;
    &lt;p&gt;Ik ben donker en duister maar ook heel belangrijk voor de natuur.&lt;/p&gt;
    &lt;p&gt;ofzoiets... geen zin. lat0rzzzzzzzzzzzzzzzzzzzzzz&lt;/p&gt;

It's in Dutch but I assume you get the point.
HTML Text dumped to JavaScript array breaks my code
===

I'm trying to dump a PHP array to a JavaScript one. (without using any extra extensions)
So far I've managed to make it dump the ID and titles of the text items it retrieves from the database but as soon as I try to dump the text item content the whole script breaks.

    <script type="text/javascript">
	var idList=new Array();
	var titleList=new Array();
	var contentList=new Array();
	<?php
	foreach($list["id"] as $index => $value)
	{
		$content = htmlentities($list["tekst"][$index], ENT_QUOTES);
		echo('idList.push('.$list["id"][$index].');');
		echo('titleList.push("'.$list["title"][$index].'");');
		//echo('contentList.push("'.$content.'");');
	}
	?>
	</script>
The line that breaks the whole script has been commented out.
Here's one of the strings that is pushed to contentList:

    &lt;p&gt;Ik ben onweer. ROMMELDEBOMMEL!&lt;/p&gt;
    &lt;p&gt;Ik ben donker en duister maar ook heel belangrijk voor de natuur.&lt;/p&gt;
    &lt;p&gt;ofzoiets... geen zin. lat0rzzzzzzzzzzzzzzzzzzzzzz&lt;/p&gt;

It's in Dutch but I assume you get the point.