php - Get parameters and folders depth in a path -


how can take url path , break

  • the params, in case param1=1 , param2=2
  • the end script, levele
  • the middle folders in script levela, levelb, levelc, leveld

.

http://test.com/ levela/ levelb/ levelc/ leveld/ levele ? param1=1 & param2=2 

another example this, folder depth different, , number of parameters different:

http://test.com/ levela/ levelb/ levelc/ leveld ? param1=1 & param2=2 & param3=3 

use parse_url() split url, , parse_str() split query string components.

the levela/levelb/levelc part best split using explode().


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -