I have the following code:
$el = "<div style='padding: $padding'></div>";
The problem is i cannot write
$el = "<div style='padding: $paddingpx'></div>";
because $paddingpx would then be another variable.
And this will produce a wrong css value
$el = "<div style='padding: $padding px'></div>";
because if $padding = 20 then '20 px' is wrong and should be '20px'.
How do i concatenate 'px' to the above code. Note that the variable $padding is a value that i will receive from the $_POST action. I would like to know how i can concatenate 'px' with the padding style value without creating any further lines of code of breaking the string like so.
$el = "<div style='padding: $padding"."px".'></div>";
Thank you, MMK.
$el = "<div style='padding: {$padding}px'></div>";