>Reminder for me : modulo in PHP

>

for($i=0;$i<10;$i++)
{
if($i % 2)
{
// I'm in an even row
}else{
// I'm in an odd row
}
}
 
 
Can be use for creating rows... 
example 
 
$x=10
 
//start the table

for ($i=0; $i<$x; $i++) 
{
if($i % 3)  {
        
        }
        else {
        
        

content

        }
}
 
//for the ending 
if($x % 3)
        {
        echo "

"; } else{

        echo "

"; }

 
 
echo "
content here

“;




 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s