How to obtain part of the url with php : <p>I am coming up with a way to display user profiles. Right now I am able to insert the user_id into the url when going to a user's profile, but I am unsure of how to get the user_id from the url.</p>

<p>So at the end of the url I have this:</p>

<p>profile?user=41</p>

<p>I just want to be able to get the 41 (please note this number will change per profile) and then set it to a variable.</p>

<p>How would I do this?</p>
