84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
将表格的字符串return 回去是什么意思?
Table string? -PHP Chinese website Q&A-Table string? -PHP Chinese website Q&A
Let’s take a look and learn.
就是函数会返回整个表格的html代码,像下面这样
<?php function biaoge($color,$width=10,$height=10,$color2='yellow'){ $resault = '<table width="800px" border="1">'; $i=0; $k=0; while ($i<$width) { $resault= $resault . '<tr>'; $j=0; while ($j < $height) { if ($i%2==0) { $resault= $resault .'<td bgcolor="'.$color.'">'.$k.'</td>'; } else{ $resault= $resault .'<td bgcolor="'.$color2.'">'.$k.'</td>'; } $j++; $k++; } $i++; $resault= $resault .'</tr>'; } $resault= $resault . '</table>'; return $resault; } echo biaoge('pink',4,7,'yellow'); ?>
Table string? -PHP Chinese website Q&A-Table string? -PHP Chinese website Q&A
Let’s take a look and learn.
就是函数会返回整个表格的html代码,像下面这样