I was wondering if i have a function like this:
function isAdmin ($user_id) {
$admin_arr = array(1, 2);
foreach ($admin_arr as $value) {
if ($value == $user_id) {
return true;
}
}
return false;
}
Could i make an array outside of that function as a global array and use it inside the function without sending it through as a parameter, also instead declaring a new admin array inside the function as i just did above? How would i do this?
Regards,
Alexander
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…