【发布时间】:2009-12-12 01:32:01
【问题描述】:
我的打印有问题"<option value...";
一行php代码。
它不断生成错误消息: 除非指定了 SHORTTAG YES,否则属性值规范必须是属性值文字
<option value = Addition>Addition</option>
<and so on...>
好的,那我该如何修复这行代码:
//foreach loop to cycle through the array
foreach ($testFiles as $myFile)
{
$fileBase = substr($myFile, 0, strlen($myFile) - 5);
**//Problem here:**
print "<option value = $fileBase>$fileBase</option>\n";
} // end foreach
这就是它与 html 兼容,php 代码工作正常,我只需要对 html 进行验证,因为您无法验证 php,并且变量 $fileBase 引用了一个 html 文件,在这种情况下,Addition 将是其中之一分配给 $fileBase 的文件。
【问题讨论】:
标签: php html validation