In Javascript or PHP, when a loop inside of a function breaks, does it return the function as well?
for instance, In javascript:
function scan() {
for (var i = 0; i <= document.register.length; i++){
}
return false;
}
the return false statement doesn't execute. It will only work if I place it inside the for loop.
I am returning false to prevent a form from being submitted.
Does PHP behave like this as well?
for instance, In javascript:
function scan() {
for (var i = 0; i <= document.register.length; i++){
}
return false;
}
the return false statement doesn't execute. It will only work if I place it inside the for loop.
I am returning false to prevent a form from being submitted.
Does PHP behave like this as well?