I have this PHP file wherein I need this javascript variable available (inside the same file) to be pass on my PHP variable, something like this.
myfile.php contais:
var testing = ["EWMLMc3ES3I", "RSdKmX2BH7o", "SIXwlxhjaKY", "acp8TbBPVos", "6GpKR4-TLoI", "XLKLkTnKRwg", "6WPELkw5kD0"];
and I want to make it like this
testing = <?php $new_testing ?>
I need a suggestion maybe a jquery snippet but with something like my scenario which is a javascript in a php file.
edit: additional info, the reason for this is , because there's another javascript codes (not on the same file but rather had it include via external JS) that needs that particular PHP variable. so say here's the logic:
- javascript_variable ---> php_variable (passing the javascript variable to php) then,
- php_variable --> another_javascript_variable (pass the php to another javascript file)
- the another_javascript_variable will the be executed by that external javascript file