Selamlar, codeigniter ile bir proje yapıyorum fakat şöyle bir sorunla karşılaştım.
public function addService()
{
function seflink($text)
{
$find = array('Ç', 'Ş', 'Ğ', 'Ü', 'İ', 'Ö', 'ç', 'ş', 'ğ', 'ü', 'ö', 'ı', '+', '#');
$replace = array('c', 's', 'g', 'u', 'i', 'o', 'c', 's', 'g', 'u', 'o', 'i', 'plus', 'sharp');
$text = strtolower(str_replace($find, $replace, $text));
$text = preg_replace("@[^A-Za-z0-9\-_\.\+]@i", ' ', $text);
$text = trim(preg_replace('/\s+/', ' ', $text));
$text = str_replace(' ', '-', $text);
return $text;
}
$service = $this->input->post('service');
$name_of_file = seflink($_FILES['file']['name']);
$config['upload_path'] = 'assets/img/services/';
$config['allowed_types'] = '*';
$this->load->library('upload', $config);
$this->upload->do_upload('file');
$this->load->model('M_Services');
$this->M_Services->addService($service, $name_of_file);
redirect(base_url('admin/Services'), 'refresh');
}Böyle bir kod yapım var Örnek Resim adlı resimi ornek-resim olarak kayıt edebiliyorum ama dosyayı assets/img/services/ konumuna Örnek Resim diye kayıt ediyor nasıl ornek-resim yaptırabilirim