Difference between base_url (); and base_url (‘assets / example’);

Posted on

Question :

What would be the difference between them? Because in my project I used both and could not identify the difference.


Answer :

Very simple, base_url () in codeigniter returns the base url, let’s say your site is: link vc calling base_url () function will return this.

If you pass the parameter, it will return the base + parameter, eg:
let’s say you want to access an article from your blog.

echo base_url("blog/post/123");


For more information, visit link


Leave a Reply

Your email address will not be published. Required fields are marked *