解决方案已找到并得到投票。
以下是我的代码:
以下是我的代码:
//go through each question
foreach($file_data as $value) {
//separate the string by pipes and place in variables
list($title, $content, $date_posted) = explode('|', $value);
//create an associative array for each input
$file_data_array['title'] = $title;
$file_data_array['content'] = $content;
$file_data_array['date_posted'] = $date_posted;
}
发生的情况是 assoc 值不断被擦除。有没有办法让值附加到数组中?如果不能,我还能用什么其他方法实现这个功能?