Question Everything!
New member
How do i declare the variable array set in the notify function to global so that the while loop can echo it?
------------------------------------------------
function notify($code, $type, $reason, $solution) {
$i = count($notify['type']);
$notify['code'][$i] = $code;
$notify['type'][$i] = $type;
$notify['reason'][$i] = $reason;
$notify['solution'][$i] = $solution;
}
notify(0990, 'error', 'incorrect user and pass', 're-enter login credentials');
$i = 0;
while ($i <= count($notify['type'])) {
echo '<div id="notify" class="'.$notify['type'][$i].'" onclick="javascript: closeDiv(this, \'slideUp\');" title="Close. (Error Code: '.$notify['code'][$i].')">';
echo '<b>'.$notify['reason'][$i].'</b>';
echo "<br />";
echo $notify['solution'][$i];
echo '</div>';
unset($notify['code'][$i], $notify['type'][$i], $notify['reason'][$i], $notify['solution'][$i]);
$i++;
}
------------------------------------------------
function notify($code, $type, $reason, $solution) {
$i = count($notify['type']);
$notify['code'][$i] = $code;
$notify['type'][$i] = $type;
$notify['reason'][$i] = $reason;
$notify['solution'][$i] = $solution;
}
notify(0990, 'error', 'incorrect user and pass', 're-enter login credentials');
$i = 0;
while ($i <= count($notify['type'])) {
echo '<div id="notify" class="'.$notify['type'][$i].'" onclick="javascript: closeDiv(this, \'slideUp\');" title="Close. (Error Code: '.$notify['code'][$i].')">';
echo '<b>'.$notify['reason'][$i].'</b>';
echo "<br />";
echo $notify['solution'][$i];
echo '</div>';
unset($notify['code'][$i], $notify['type'][$i], $notify['reason'][$i], $notify['solution'][$i]);
$i++;
}