<?php defined('BASEPATH') OR exit('No direct script access allowed');

if ( ! function_exists('current_page_url'))
{
	/**
	 * Returns current page url.
	 */
	function current_page_url()
	{
		$ci = &get_instance();

		$index_page = ($ci->config->item('index_page')!=='')? $ci->config->item('index_page').'/':$ci->config->item('index_page'); 

		return str_replace(base_url().$index_page,'',current_url());
	}
}