【问题标题】:How to add Function to URL in PHP如何在 PHP 中将函数添加到 URL
【发布时间】:2016-03-07 10:17:50
【问题描述】:

我有这样的代码

function demo() {
    echo 'this is demo';
}

我想在此处添加此功能:

http://domain.com/index.php/demo

可能吗?我在 Codeigniter 中看到了这一点。

【问题讨论】:

    标签: php function url


    【解决方案1】:

    您不能“向 URL 添加函数”。但是,您可以在 URL 中设置一些 GET 变量并在另一个页面上捕获这些变量。

    您应该看看http://php.net/manual/en/reserved.variables.get.php 了解如何使用它们

    【讨论】:

      猜你喜欢
      • 2014-05-11
      • 2020-09-06
      • 2014-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-19
      • 1970-01-01
      • 2011-07-23
      相关资源
      最近更新 更多