How to get current, past and server URL with php


When you want to get the current URL of a site there is a PHP code


Im forgetting this all the time. How do you get the current URL etc:

Get variable only:


Get the left complete server part:


Get the right part:


Get only host


Get no seo:


Previous url



Substr in another one I always forget

$rest = substr ("abcdef", 1); // geeft "bcdef" $rest = substr ("abcdef", 1, 3); // geeft "bcd" $rest = substr ("abcdef", 0, 4); // geeft "abcd" $rest = substr ("abcdef", 0, 8); // geeft "abcdef"

$rest = substr ("abcdef", -1); // geeft "f" $rest = substr ("abcdef", -2); // geeft "ef" $rest = substr ("abcdef", -3, 1); // geeft "d"

Handige links

Reacties (0)

Geen resultaten gevonden