how would i write this in shorthand?
something like this?Code:<?$i = 0;?> foreach($datas as $row){ ?> <ul class="title<? if($i % 0 {echo "0"; }else {echo "1"})?>"> <li></li> </ul> <? $i+=1;}?>
Code:$i % 0 ? echo"0" : echo"1"
how would i write this in shorthand?
something like this?Code:<?$i = 0;?> foreach($datas as $row){ ?> <ul class="title<? if($i % 0 {echo "0"; }else {echo "1"})?>"> <li></li> </ul> <? $i+=1;}?>
Code:$i % 0 ? echo"0" : echo"1"
Last edited by ggalan; 06-06-2011 at 01:49 PM.
Your very close.
This will work.
PHP Code:echo ($i%0)?"0":"1";
ggalan (06-06-2011)
Bookmarks