PHP take arguments from URL path

前端 未结 4 2139
南笙
南笙 2021-01-05 14:34

Say I have a url like this:

http://www.mysite.com/forum/board1/sub-forum/topics/123

Is there a simple way in PHP (can\'t use HTAccess) to take t

4条回答
  •  庸人自扰
    2021-01-05 15:29

    You can, but without redirecting requests your webserver will just return a 404 error for non-existing paths.

    However, you can use urls like http://your.site.com/index.php/foo/bar/baz and then split the url into parts like @pestaa said which you can then parse into parameter values.

提交回复
热议问题