Im trying to reset $i to 0 and print the word margin...is this doable the way im trying to pull it off?
class="customGal'.($i == '2' ? $i = '0' && 'margin' : NULL).'"
Thanks in advance.
Im trying to reset $i to 0 and print the word margin...is this doable the way im trying to pull it off?
class="customGal'.($i == '2' ? $i = '0' && 'margin' : NULL).'"
Thanks in advance.
Why do it in such a "dirty" way? Why can't you simply add an if statement to check if $i is 2 and reset it to 0, and use the conditional expression for the print-out only (which is the way it it intended to be used)?
"Perl-nerd-style" programming (which involves very very short and complex concoctions) is charming, but really hard to understand later on...
You are doing it wrong way.
Take a habit using templates
So, in the getting data part write a readable code :
if ($i == 2) $row['margin'] == 'whatever';
And then in the template part:
class="customGal<?=$row['margin']?>"