I'm trying to build a PHP API. So far I've implemented the model of the API using a class called API, having all the methods for adding/removing/updating etc. I want to make an API, so that e.g.:
example.com/post/add/data...
Turns into a request, which calls the proper methods of the model. I just have no idea about how to turn URL/URI's into method calls of the model class.
$_SERVER['REQUEST_URI'].