From 62efa28796a08a8a72f3ecc7c61061fb66f4143b Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Thu, 28 Nov 2024 02:01:26 -0700 Subject: [PATCH] convert for() to foreach() --- access.php | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/access.php b/access.php index 24e0107ed..2e3c64363 100644 --- a/access.php +++ b/access.php @@ -183,18 +183,20 @@ '; - for( $i = 0, $cnt = count( $userlist ); $i < $cnt; $i++ ) { + + foreach ( $userlist as $i ) { echo ' - '; + '; } - for( $i = 0, $cnt = count( $nonuserlist ); $i < $cnt; $i++ ) { + + foreach ( $nonuserlist as $i ) { echo ' - '; + '; } echo $goStr; @@ -294,14 +296,15 @@ . ( $otheruser == '__default__' ? $selected : '' ) . '>' . $defConfigStr . ''; - for( $i = 0, $cnt = count( $userlist ); $i < $cnt; $i++ ) { - if( $userlist[$i]['cal_login'] != $guser ) + foreach ( $userlist as $i ) { + if ( $i['cal_login'] !== $guser ) echo ' - '; + '; } + echo $goStr; } } @@ -475,4 +478,4 @@ function get_list_of_users( $user ) { return $u; } -?> +?> \ No newline at end of file