数据
3 uploads/8/thumbs/8470177001370850253.png
3 uploads/10/thumbs/967693821370850253.png
3 uploads/9/thumbs/8470177001370850253.png
3 uploads/11/thumbs/967693821370850253.png
我的输入是 id="20" 现在我需要为每个 id 3 静态更改为“uploads/20/thumbs/967693821370850253.png”。我需要这样的输出..
3 uploads/20/thumbs/8470177001370850253.png
3 uploads/20/thumbs/967693821370850253.png
3 uploads/20/thumbs/8470177001370850253.png
3 uploads/20/thumbs/967693821370850253.png
我试过爆炸和内爆,但我不能改变它怎么办?我将从数据库中检索数据。
我的编码是
function albums_download($input, $serviceName) {
$ipJson = json_encode($input);
$this->db->select('photo_thumb_url,photo_url');
$this->db->from('photos');
$this->db->where('album_id', $input['album_id']);
$query = $this->db->get();
$result = $query->result();
foreach ($query->result() as $row)
{
$data[] = $row->photo_thumb_url;
$data[] = $row->photo_url;
$explode_data = explode('/',$row->photo_thumb_url);
$explode_data[1] = 20;
$data['change'] = implode('/', $explode_data);
}
$status = $this->privue_lib->return_status('success', $serviceName, $data, $ipJson);
return $status;
}