Stop using each()

The each() function has been deprecated as of PHP 7.2.0. Use foreach
loops instead.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2018-05-12 13:35:11 +02:00
parent 8838490665
commit 4b8b2e3eb1
11 changed files with 29 additions and 29 deletions

View file

@ -18,7 +18,7 @@ else:
</thead>
<?php
$i = 0;
while (list($indx, $row) = each($userinfo)):
foreach ($userinfo as $indx => $row):
if ($i % 2):
$c = "even";
else:
@ -51,7 +51,7 @@ else:
</tr>
<?php
$i++;
endwhile;
endforeach;
?>
</table>
@ -64,10 +64,10 @@ else:
<input type="hidden" name="O" value="<?= ($OFFSET-$HITS_PER_PAGE) ?>" />
<?php
reset($search_vars);
while (list($k, $ind) = each($search_vars)):
foreach ($search_vars as $k => $ind):
?>
<input type="hidden" name="<?= $ind ?>" value="<?= ${$ind} ?>" />
<?php endwhile; ?>
<?php endforeach; ?>
<input type="submit" class="button" value="&lt;-- <?= __("Less") ?>" />
</fieldset>
</form>
@ -79,10 +79,10 @@ else:
<input type="hidden" name="O" value="<?= ($OFFSET+$HITS_PER_PAGE) ?>" />
<?php
reset($search_vars);
while (list($k, $ind) = each($search_vars)):
foreach ($search_vars as $k => $ind):
?>
<input type="hidden" name="<?= $ind ?>" value="<?= ${$ind} ?>" />
<?php endwhile; ?>
<?php endforeach; ?>
<input type="submit" class="button" value="<?= __("More") ?> --&gt;" />
</fieldset>
</form>