I’m using this code:
$permissions = array("canview", "canpostthreads", "canpostreplies", "canpostpolls", "all");
foreach($permissions as $permission) {
for ($i = 1; $i <= 5; $i++) {
$mode = $_POST['permission'][$i][$permission];
if($mode == 1)
echo "{$permission} = {$i}:::";
}
}
And the output if I check some checkboxes is:
canview = 1:::canview = 5:::canpostreplies = 3:::canpostpolls = 5:::
I wan’t the output to be following:
instead of canview = 1:::canview = 5:
canview = 1,5
and if I’ll have for example:
canpostpolls = 1:::canpostpolls = 2:::canpostpolls = 3
It’ll be:
canpostpolls = 1,2,3:::canview = 1,5
I hope you understand it guys. This is my own idea for this, you are free to share your ideas with me, this data will be exported to the mysql table.
1 Answer