I hope you're all doing well. I'm currently working on a PHP project and I am facing an issue. I have a URL and I need to extract the ID from it and store it in a variable.
Let me give you some context. In my project, I have different pages that are accessed based on their unique IDs. For example, the URL may look something like this: `http://example.com/page.php?id=12345`. In this case, I want to extract the ID `12345` and store it in a variable for further processing.
I've been trying to figure out the best way to achieve this, but I'm not sure where to start. Should I use regular expressions or is there a built-in function in PHP that can help me accomplish this?
I would appreciate any guidance or code snippets you can provide to help me solve this issue. Thank you in advance for your time and assistance!