答案 0 :(得分:0)
要将$ array 1 [picture_names]转换为数组本身,您可以使用" explode()"功能
array explode ( string $delimiter , string $string [, int $limit = PHP_INT_MAX ] )
在你的具体例子中:
$results = $this->db->get()->result_array();
$exp_results = explode(',', $results);
哪个应该给出一个数组:
$exp_results = Array (
0 => 21
1 => 22
2 => 25
3 => 27
4 => .... etc
)
答案 1 :(得分:0)
在查询
后添加这些行$result = $this->db->get()->result_array();
foreach($result as $key=>$row) {
$result[$key]['picture_names'] = explode(',',$row['picture_names']);
}