[英]Get parameters from url without query string htaccess rules
I want to get parameters from url, instead of query string. 我想从网址获取参数,而不是查询字符串。
For Example myhost/index.php/my_value
. 例如
myhost/index.php/my_value
。
I want to get this my_value
instead if myhost/index.php?id=my_value
. 我希望得到这个
my_value
,而是如果myhost/index.php?id=my_value
。
Any defined custom rule for this approach? 是否为此方法定义了自定义规则?
you can extract the request and separate in to parts. 您可以提取请求并分成多个部分。
$uri_segments = explode("/",$_SERVER['REQUEST_URI']);
echo end($uri_segments);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.