Home > Backend Development > PHP Tutorial > The difference between site_url() and base_url() in CI framework, site_urlbase_url_PHP tutorial

The difference between site_url() and base_url() in CI framework, site_urlbase_url_PHP tutorial

WBOY
Release: 2016-07-13 10:10:05
Original
800 people have browsed it

The difference between site_url() and base_url() in the CI framework, site_urlbase_url

When using CI frameworks, we often encounter problems with jumps and paths. Site_url() and base_url() are easy to confuse. Let’s talk about their differences below!

If base_url and index_page in your config file are defined like this:

config['base_url'] = "http://domain.com/";

config['index_page'] = "index.php";

Then if you use site_url("news/php/2"); then the actual url is

http://domain.com/index.php/news/php/2

If base_url("news/php/2"); is used, the url is:

http://domain.com/news/php2

No, base_url() is missing an index.php

The above text is very simple. Do you guys understand the difference between site_url() and base_url() in the CI framework? If you have any questions, please leave a message.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/939407.htmlTechArticleThe difference between site_url() and base_url() in CI framework, site_urlbase_url often encounters jumps when using CI framework Regarding transfer and path issues, it is easy to confuse site_url() and base_url(). Let’s follow...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template