Tutorialsplane

Codeigniter get base url


base_url() returns the base url in codeigniter.

Codeigniter get base url

Helper required for base_url() in php.

Load Helper as following.

  $this->load->helper('url');

or You can autoload helper url in autoload.php
as :

 $autoload['helper'] = array('url'); 

Now Get the base_url() as :

Codeigniter get base url – Example

echo base_url();