This question already has an answer here:
I used
<?php
$myArr = "foo" => "bar",
"bar" => "foo",;
$myVar = "Word!";
echo '<script type="text/javascript">alert("The $myVar is print_r($myArr) ");</script>';
?>
To show an alert on the page. I take it is wrong, whats the right way of doing so?
</div>