【发布时间】:2010-06-14 21:43:02
【问题描述】:
echo $path; //working
function createList($retval) {
echo $path; //not working
print "<form method='POST' action='' enctype='multipart/form-data'>";
foreach ($retval as $value) {
print "<input type='checkbox' name='deletefiles[]' id='$value' value='$value'>$value<br>";
}
print "<input class='submit' name='deleteBtn' type='submit' value='Datei(en) löschen'>";
print "</form>";
}
我做错了什么?为什么 $path 在 createList 函数之外正确打印,但在函数内部无法访问?
【问题讨论】:
-
$path在哪里定义?是否定义为global $path?