How can I find an application's base url?

后端 未结 11 1393
南方客
南方客 2020-12-16 01:35

I\'d like to find the base url of my application, so I can automatically reference other files in my application tree...

So given a file config.php in the base of my

11条回答
  •  無奈伤痛
    2020-12-16 01:58

    Unless you track this yourself, I don't believe this would have a definition. Or rather, you're asking PHP to track something that you're somewhat arbitrarily defining.

    The long and short of it is, if I'm understanding your question correctly, I don't believe what you're asking for exists, at least not as "core" PHP; a given framework may provide a "root" URL relative to a directory structure that it understands.

    Does that make sense?

提交回复
热议问题