Web results PHP Get URL with Parameter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Web results PHP Get URL with Parameter

I want to get a URL and its parameters. Example: www.someweb.com/somepage.php?id=10 How to get only somepage.php?id=10?

31st Mar 2019, 1:13 PM
Mohammed Ashad
Mohammed Ashad - avatar
1 Answer
+ 3
Take a look at this code, I used some string functions to extract the path and arguments off a URL. The `get_last_chunk` function does what you wanted, and I made another function `get_arguments`, which returns the path and arguments in a form of an array. https://code.sololearn.com/wD4Lu50N78kL/?ref=app Hth, cmiiw
31st Mar 2019, 6:21 PM
Ipang