Stump of a Muffin

PHP – Even or Odd In Loop

<?php
// $stuff
$stuff = ”;
for( $i = 1; $i <= 10; $i++ ) {

$i_am = ( $i&1 ) ? ‘odd’ : ‘even’ ;
$stuff = ‘<p>’ . $i . ‘ I\’m ‘ . $i_am . ‘.</p>
‘;

}

print $stuff;

Comments are closed.