PHP: variable not working inside of function?
Posted
by mathiregister
on Stack Overflow
See other posts from Stack Overflow
or by mathiregister
Published on 2010-06-14T21:43:02Z
Indexed on
2010/06/14
21:52 UTC
Read the original article
Hit count: 184
hi guys,
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>";
}
what am I doing wrong? why is $path printed corretly outside of the createlist function, but it's not inside of the function?
© Stack Overflow or respective owner