发现的解决方案和投票用foreach将值添加到关联数组中?
这里是我的代码:
//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命令值继续得到清除。有没有一种方法可以将值附加到数组中?如果不是,我还能怎么做?
你必须接受正确的答案^ _^ – Neal 2011-03-30 22:23:08
没有让我的第15分钟。我的评论有点抢先。 。 。 – Phil 2011-03-30 22:27:24
啊好吧。得到它 – Neal 2011-03-30 22:28:25