1, output the following statements to the results
The <?php//While statement applies $i = 1;while ($i <=) { echo $i; if ($i <) echo ""; ElseIf ($i% = = 0) echo "<br/>\n"; else echo ""; $i + +;} echo "<br/>\n";//do...while statement Applied $i = 1;do { echo $i; if ($i <) echo ""; ElseIf ($i% = = 0) echo "<br/>\n"; else echo ""; $i + +;} while ($i <= 20);? >
2. Output the results of the following files include.php and require.php
File Inc1.inc
<?php $var 1 = "This is the value of a variable in the Inc1.inc file!<br>"; if (Isset ($int)) { $int + +;} else{$int = 1;}? >
File inc2.in
<?PHP$VAR2 = "This is the value of a variable in the Inc2.inc file!<br>";? >
File include.php
File require.php Content
3. Use the dual for loop to dynamically create a table and change the background color of the odd and even rows alternately,
Tables generated through a for loop
| 1th Row 1th Column |
1th Row 2nd Column |
1th Row 3rd Column |
| 2nd row 1th Column |
2nd row 2nd Column |
2nd row 3rd Column |
| 3rd row 1th Column |
3rd row 2nd Column |
3rd row 3rd Column |
| 4th row 1th Column |
4th row 2nd Column |
4th row 3rd Column |
| 5th Row 1th Column |
5th row 2nd Column |
5th row 3rd Column |
PHP Experiment 2