I have two global variables declared in my config.php file, I would like to call one of these depending on results from another page however I need some help with my syntax.
It simply add a class to the button (btn-success
or btn-default
)
config.php
define("BTN_SUCCESS", "btn-success");
define("BTN_DEFAULT", "btn-default");
I want to do something like the following but it doesn't work it simply prints out the names in my html source;
echo '<td>
<button id="fav" type="button" class="btn '.BTN_SUCCESS. || 'BTN_DEFAULT''"></button>
</td>';
If I insert either of them individually they work but it's not what I want, for example;
echo '<td>
<button id="fav" type="button" class="btn '.BTN_SUCCESS.'"></button>
</td>';
I want an or operator in there - is this possible? It's probably something simple. Quite new to php so any help is appreciated.