I have some code, a foreach loop, that iterates through a $_post array but I have only just learnt that the foreach loop changes spaces to underscores so on usernames with spaces it is not working.
for example..
The form sends this...
<input name='".$row['username']."' type='checkbox' value='yes' />
and the processing script does this...
foreach($_POST as $username => $value){
$sql = $database->connection->prepare("UPDATE ".TBL_USERS." SET USERLEVEL = '3' WHERE username = '$username'");
$sql->execute();
IS there any other way to do this? I cant using strtr or such like as there may be cases where users have underscores and I wont want these being replaced with spaces.