-2

How i can check in php, in what format displayed url xn--d1acufc5f.xn--p1ai or домены.рф

I try use $_SERVER['HTTP_HOST'] but browsers where supporting punycode, http_host return no encoding version

  • *"in what format displayed url"* – what does that mean? Your server will always see the punycoded version, because that *is* the actual URL, and the browser may or may not display it nicely, you simply have no idea. – deceze Mar 23 '18 at 20:24
  • @deceze And my question is how check browser display it nicel or not – user3272368 Mar 23 '18 at 20:29

1 Answers1

2

You simply won't have any idea how the browser displays a punycoded URL. It is entirely up to the browser, there is no information communicated between the browser and your server that would enable PHP to know this.

deceze
  • 510,633
  • 85
  • 743
  • 889