Is there a way to make a loop that would give me this, depending on the number of users I want to grab?
$user1 = htmlentities($_POST['user1']);
$user2 = htmlentities($_POST['user2']);
$user3 = htmlentities($_POST['user3']);
I've tried this:
while ($i <= $useramm) {
${"user$i"} = htmlentities($_POST['user-' + $i]);
$i=$i+1;
}
but it shows me these errors:
Warning: A non-numeric value encountered in C:\xampp\htdocs\test.php on line 14 Notice: Undefined offset: 1 in C:\xampp\htdocs\test.php on line 14