Hi, I've a function which consist of 5 arguments.
function make_checkbox_html($arr, $num, $width, $name, $checked) {
$i = 1;
if (isset($checked)) {
/* if we passed in an array of the checkboxes we want
to be displayed as checked */
foreach ($arr as $ele) {
$str .= "<td><input type=\"checkbox\" name=\"$name\" value=\"$ele->id\"";
foreach ($checked as $entry) {
if ($entry == $ele->value) {
$str .= "checked";
continue;
}
}
$str .= ">";
$str .= "$ele->value";
if ($i % $num == 0) {
$str .= "</tr>\n<tr>";
} else {
$str .= "</td>\n";
}
$i++;
}
} else {
The $checked was meant to be default but I get an error Warning: Missing argument 5 for make_checkbox_html() when I tried to use this.
$available = make_checkbox_html($favorites, 3, "100%", "favorites[]");
Any help?