Use continue
:
continue is used within looping structures to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration.
if (!$ssh->login('username', 'password')) {
echo('Login Failed'); // <-- remove if desired
continue;
}
If you want your loop to end when you find a successful server connection you would use break
, too:
if (!$ssh->login('username', 'password')) {
continue;
}
else {
break;
}