Couple of problems: Here is the first

I am trying to convert a piece of my code from an “if statement” to a “for loop” and I’m having problems doing so. If anyone could help me out, it would be greatly appreciated. Thanks!

[php]if (empty($scores[0]) ||
empty($scores[1]) ||
empty($scores[2]) ||
!is_numeric($scores[0]) ||
!is_numeric($scores[1]) ||
!is_numeric($scores[2])) {
$scores_string = ‘You must enter three valid numbers for scores.’;
break;
}[/php]

[php]
for($i=0; $i < count($scores); $i++) {
if(empty($scores) || !is_numeric($scores)) {
$scores_string = ‘You must enter three valid numbers for scores.’;
}
}[/php]

Something like that.

Thank you for your help!

Sponsor our Newsletter | Privacy Policy | Terms of Service