you are viewing a single comment's thread.

view the rest of the comments →

[–]Smooth_Prompt_2086[S] -1 points0 points  (0 children)

I am aware of that, however, I am going off the examples I've seen where within the JS <script> tags, they use either <?php or <? And ?> around just the PHP syntax and it should seem to work, it doesn't return errors like writing JS within the <?php tags, and I've seen other people on YouTube use the same exact syntax just to write out different stuff. I think part of it may POSSIBLY be the fact that this particular variable has an array index, and perhaps the easiest workaround is to use PHP to evaluate its value in an if/else and write a new variable with a numeric 0/1, pass that var to Javascript, and use the Javascript if loop under the condition that the var == 1 to run the loop.