$referer = $_SERVER["HTTP_REFERER"];
I use the above code For example Someone who came to my site from Google prints like this :