html - php variable in style (width) attribute -


i have php echo, , use variable width attribute avoid needing if statement. tried use code:

<?php echo variable; ?> 

it didn't work.

here code:

echo "<div class='progress-bar progress-bar-success' role='progressbar' aria-valuenow='25' aria-valuemin='0' aria-valuemax='100' style='width: (variable)'>"; 

does work:

echo   "<div class='progress-bar progress-bar-success' role='progressbar' aria-valuenow='25' aria-valuemin='0' aria-valuemax='100' style='width: ".$variable."'>"; 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -