I am trying to create a url for search results with input values included in url. Everything is working fine except "blank spaces".
I am getting this at the moment:
localhost/admin/search-results/san diego-01/25/2016-01/27/2016-guest House-7
PS, 'San Diego' & 'Guest House'. I can manually change the value of drop downs by adding '-' in value but I afraid doing so will not query DB. Same goes for location text input.
Controller:
public function custom_search() {
$seg1 = $this->input->post('search[1]');
$seg2 = $this->input->post('search[2]');
$seg3 = $this->input->post('search[3]');
$seg4 = $this->input->post('search[4]');
$seg5 = $this->input->post('search[5]');
$segment_array = $this->input->post('search');
$segments = implode("-", $segment_array);
redirect('search-results/'.$segments);
}