Read variables in URL as fuction in php -


started learning php week , had many doubts, 1 of them couldn't find solution(maybe didn't know right keyword search for).

is possible read variables in url function inside php file, example :

  http://mywebsite.com/demo_app/phone_api/login/harsha/harshapass 

here demo_app folder, phone_api php file, , want invoke function login, harsha , harshapass paramaters function.

you'll need 2 things this.

the first mod_rewrite, apache module. module can rewrite url want, /demo_app/phone_api/ redirect php file.

i advice read tutorial somewhere this, example here.

second thing need parse url.

with $_server['request_uri'] url. explode and/or preg_match can parse string parts want (function, parameters, whatever).

if have more specific question this, can ask here (in new topic).

good luck!


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -