如何从url解析数据.(漂亮的URL)


How to parse data from url. (pretty urls)

所以使用$_GET[],您的url看起来像

yourdomain.com/index.php?page=home | lets say this loads home

我希望它是

yourdomain.com/home

我也不想有很多文件夹有一堆index.php,我想通过索引运行所有内容。

我该怎么做?

谢谢!

示例:

mysite.com?var1=20&var2=this_is_a_new_article

当然,在index.php文件中,您可以简单地使用获取值

$var1=$_GET['var1'];$var2=$_GET['var2'];