I want to use mod_rewrite with PHP, parse the URL with this format:
http://www.domain.com/Path-to-index.php/Class_to_Load/Function_to_Execute/Arguments_as_array_to_the_function
The class to load will be included of the directory classes
, with a strtolower
then ucfirst
, like:
http://www.domain.com/Path-to-index.php/SAMPLE
will include classes/Sample.php
and execute the function action_index
, because no function was used.
Then, when this url is open: http://www.domain.com/Path-to-index.php/SAMPLE/Login/User
, PHP should include classes/Sample.php
and execute action_Login($args = Array(0 => "User"));
.
Please I need to know how to do that.