データ
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;
}