Please I need help fixing this. I am trying to fill a form using values of array but its messing up the form.
I want to display the af_rating in the input fields
<?php
$af_skill = array(12, 9, 6, 3, 4, 5, 7);
foreach ($af_skill as $k => $row_af):
?>
<div class="form-group">
<div class="col-sm-5">
<?php
$af_skill_rating = array(1, 2, 5, 4, 3, 2, 4);
foreach ($af_skill_rating as $k2 => $af_rating):
?>
<input type="number" class="form-control" name="af_rating-<?= $row_af[$k]; ?>" value="<?php echo $af_rating[$k2]; ?>" max="5" min="1" required> <br>
<?php endforeach; ?>
</div>
</div>
<?php endforeach; ?>

$af_ratingis a number, there's no[$k2]index for it.<?php echo $af_rating[$k2]; ?>