I have a problem when I open php tags inside script tags it doesn't load any of javascript code and when I remove php tags it works normaly.Why is that hapening?
<html>
<head>
</head>
<body>
<script>
document.write("aa");
<?php
$js_array = json_encode($podaci);
echo $js_array;
echo "var javascript_array = ". $js_array . ";\n";
?>
</script>
</body>
</html>
document.write- welcome to the 21st century, time traveller :pecho $js_arrayandecho "var javascript_array = ". $js_array . ";\n"do not work so well together.