根据您的信息,听起来您想根据选中的复选框合并一个数组?我的假设是否正确?
你正在寻找这样的东西吗?
<?php
$combinationArray = array();
$mainArray = array('item1','item2','item3');
$artArray = array('item4','item5','item6');
$gamesArray = array('item7','item8','item9');
if(isset($_POST['main']) && $_POST['main']=='main'){
$combinationArray = array_merge($combinationArray,$mainArray);
}
if(isset($_POST['art']) && $_POST['art']=='art'){
$combinationArray = array_merge($combinationArray,$artArray);
}
if(isset($_POST['games']) && $_POST['games']=='games'){
$combinationArray = array_merge($combinationArray,$gamesArray);
}
?>
HTML:
<form action="yourpage.php" method="post">
<input type="checkbox" name="main" value="main" checked> Main/unsorted<br />
<input type="checkbox" name="art" value="art" checked> Art/literature/music<br />
<input type="checkbox" name="games" value="games" checked> Games/gaming<br />
<button>
Submit
</button>
</form>