请问php中写html代码 在html中写if判断 怎么写啊(下面是错误的代码请问大虾们怎么改啊)
$str = "<td width=\"30\" height=\"23\" align=\"center\" valign=\"middle\"><input type=\"checkbox\" name=\"type[]\" id=\"type[]\" value=".$cartype[$key]."if( in_array($cartype[$key],$typelist)){echo checked;} ></td>";
作者: wxjlogo 发布时间: 2011-06-09
字符串连接运算符 .
PHP code
PHP code
$str = 'part1'; if (in_array($cartype[$key],$typelist)) $str .= ' checked="checked"'; $str .= 'part2';
作者: T5500 发布时间: 2011-06-09