我想将 mod_rewrite 与 PHP 一起使用,使用以下格式解析 URL:
http://www.domain.com/Path-to-index.php/Class_to_Load/Function_to_Execute/Arguments_as_array_to_the_function
要加载的类将包含在 directoryclasses中,带有strtolowerthen ucfirst,例如:
http://www.domain.com/Path-to-index.php/SAMPLE将包含classes/Sample.php并执行函数action_index,因为没有使用函数。
然后,当这个 url 打开: 时http://www.domain.com/Path-to-index.php/SAMPLE/Login/User,PHP 应该包含classes/Sample.php并执行action_Login($args = Array(0 => "User"));.
请我需要知道如何做到这一点。