简体   繁体   中英

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 .

I want to get this my_value instead if 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM