I have three variables ($var, $var2 & $var3) and I want it to output when they have value.
For example, if $var = "Data"; then:
<ul>
<li>Data</li>
</ul>
And if any of the other variables has value then:
<ul>
<li>Data</li>
<li>Data2</li>
</ul>
Or
<ul>
<li>Data</li>
<li>Data3</li>
</ul>
<ul>
<li>Data</li>
<li>Data3</li>
<li>Data2</li>
</ul>
I am not exactly sure how to create this and with what method considering everybody has different ways of doing their php code. Does anybody know how I can create this?
Also: I use http://writecodeonline.com/php/ when testing certain php codes.
You can see the output here on
writecodeonline.com.Or maybe you prefer this:
(it doesn’t matter really, just use whatever you think looks better)