if ($w && $d == 1) { // If the first day of the month is not a Sunday, fill in the blanks
$html .= "<td colspan=\"$w\"> ; </td>";
秋香姐家的小书童2018-09-15 11:41:55
It is not recommended to write this, you’d better write it like this
if ($w && $d == 1) { // 如果该月的第1天不是星期日,则填充空白 $html .= "<td colspan=".$w."> </td>"; }
I suggest you learn more about string splicing methods and efficiency issues
此去经年2018-09-14 10:53:09
Found it, it is an escape character. But why can’t we directly $html .= "<td colspan="$w"> </td>";
I know an error will be reported
Parse error: syntax error, unexpected '$w' (T_VARIABLE) in /home/phpcn6peh2pwcun/wwwroot/compile.php(41) : eval()'d code on line 39
Require $html .= "<td colspan=\"$w\"> </td>";
But why is this?
此去经年2018-09-14 08:14:15
This is the complete code. I don’t understand what the backslash in line 39 means. Can you help me explain it?
<!doctype html>
<html>