I’m using Slim PHP as a framework for a RESTful API.
How do I grab GET params from the URL in Slim PHP?
For example, if I wanted to use the following:
http://api.example.com/dataset/schools?zip=99999&radius=5
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do this very easily within the Slim framework, you can use:
$app here is a Slim instance.
Or if you want to be more specific
//GET parameter
//POST parameter
You would use it like so in a specific route
You can read the documentation on the request object
http://docs.slimframework.com/request/variables/
As of Slim v3: