Get url parameter in GET request using REST

0

Hello everyone, I have a question. When I make the request:

  

GET / withdraw / 30

Since the value "30" is not bound to a key, then you can not use $_GET['chave'] .

The way I found it was to do this:

$valor = end(explode("/", $_SERVER['REQUEST_URI']));

It's not very beautiful, but it works.

Is there a better way to do this without using a Framework? In CakePHP I do this well, but without it it complicated the midfield.

    
asked by anonymous 14.07.2015 / 01:03

1 answer

1

PHP does not work natively with this URL format and with so many packages as the routing function , I do not see much purpose in redoing the

What you can do is to use some component that

14.07.2015 / 14:15