.php?id=42466#.XBEd_rihlPY
This is the URL address of a page. The address is not on a remote server. I want to get the ID part, ie the number, which is only "42466" at this url.
.php?id=42466#.XBEd_rihlPY
This is the URL address of a page. The address is not on a remote server. I want to get the ID part, ie the number, which is only "42466" at this url.
You can do it by using superglobal variable $_GET. Superglobals are variables provided by PHP language to helps programmers with handle e.g. parameters in URL. They are "superglobals" because they are available in every scope in your code. In your case this:
echo $_GET['id'];
Returns you this:
42466
because the sigh # are an anchor and its not a part of the query string