| Contro Structure : for loop | |
|
<?php //for(initialization;continue;increment) {------} for ($test= 1;$test <= 10; $test++) { if (($test % 2)==0){ echo " $test is divisible by 2 <br>";} if (($test % 3)==0){ echo " $test is divisible by 3 <br>";} } ?> |
|
![]() |
|
| <?php $e_id; $e_id["Mike"] = "mk1234"; $e_id["Mat"] = "mt1234"; $e_id["Jim"] = "jm6789"; $e_id["David"] = "d4567"; $e_id["Baba"] = "b2334"; echo "<table border='1'width='200'> <tr><td width='100'>Name</td><td width='100'> ID: </td></tr></table>"; foreach( $e_id as $key => $value){ echo "<table border='1' width='200'><tr><td width='100'>$key</td><td width='100'>$value </td></tr></table>"; } ?> |
|
![]() |
|