//go through each question
foreach($file_data as $value) {
//separate the string by pipes and place in variables
list($category, $question) = explode('|', $value);
//place in assoc array
$data = array($category => $question);
print_r($data);
}
这无法正常工作,因为它替换了数据的值。我如何让它在每个循环中添加一个关联值?$file_data是具有动态大小的数据数组。