<?php $_POST = ['foo'=>"on", 'hop'=>"on", 'bar'=>5]; $protected = $_POST; foreach($protected as $key=>$value) { if($value=="on") { $protected[$key]="1"; } } var_dump($protected);
You have javascript disabled. You will not be able to edit any code.