In the index.html file there is an ordinary script, inside which is the js array (which is generated by the foreach loop from php).
<script type="text/javascript"> var cams = [ <?php foreach ((array) $this->data['video_streams'] as $video_stream): ?> { type : "html", title : "<?php echo addslashes($video_stream['name']); ?>", content : "<?php echo addslashes($video_stream['html']); ?>", }, <?php endforeach; ?> ]; </script> The bottom line is that I have another script stored in the $ video_stream ['html'] variable, which is played directly from the array. I would be very grateful if you tell me how it can be screened? I tried to add addslashers () , but it (the script) is still playing, but this time with errors due to slashes.
var cams = <?= json_encode($this->data['video_streams']) ?>? for generating arrays in cycles on pHP is not somehow not very :) - teran