Skip to content
Advertisement

define javascript variable from php variable within php code

I am trying to define javascript variable from php variable in the running php code.

Here is my code:

JavaScript

But this code not defining the javascript variable.

Advertisement

Answer

You don’t need php tags again.

Try it like this:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement