Skip to content
Advertisement

Print string with a php variable in it

For you guys, I imagine this will be easy.

JavaScript

I want the variable to be $width and for it to have px on the end. If i put a space, it doesnt work. If i put them together, it treats it as one big variable name.

Could I ask someone the correct snytax to achieve this? Thanks

Advertisement

Answer

If you mix PHP and HTML you can do:

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