我目前正在使用 codeigniter 3.0.3。我尝试使用 var_dump(base_url());
function
获取基本 url
我得到了这个结果
string 'http://localhost/' (length=17)
但我需要获取带有端口号的基本 URL。我是这样在 codeigniter 3.0.2 中获取的
string 'http://localhost:8000'
如何在 codeigniter 3.0.3 中获取带端口号的基本 URL。
最佳答案
像这样在 config.php
中设置 base_url
$config['base_url'] = 'http://'。 $_SERVER['HTTP_HOST'].'/';
关于php - 如何在 codeigniter 3.0.3 中获取带有端口号的基本 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33627957/