javascript - Assign a jquery value to text inside the same PHP passage -


It currently resides in some web pages in the web page source:

  echo (" & Lt; span class = \ "somevalue \" & gt; & lt; / span & gt; ");   

This works, the value is expressed on the page where the PHP instructions are applied. But now - instead of announcing an echo () - how can it be assigned a text variable that I can use somewhere else in PHP? Thanks for any help.

You can specify the string in a variable

  $ mySpan = "& Lt; span class = \" somevalue \ "& gt; & lt; / span & gt;";   

and then echo the variable later in the code anywhere in the code. You can define $ mySpan at the top of the script or you can define it in a separate file and you can include that file in another file, you will need the variable.

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -