0

Hello i got code where i put my images in array

<?php

foreach (array_merge(glob("NU/*.[jJ][pP][gG]"),glob("NU/*.[pP][nN][gG]"),glob("NU/*.[jJ][pP][eE][gG]"),glob("NU/*.[gG][iI][fF]")) as $filename) {
}

?> 

and i got javascript where i must use this $filename! how can i put this value in javascript operations? some example would be welcome and appreciated ;)

1 Answer 1

1
<?php
print "<script type=text/javascript>var foo=$foo</script>";
?>

All the usual caveats about the safety of code injection and string escaping apply.

Sign up to request clarification or add additional context in comments.

1 Comment

But if i got separated javascript file from php file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.