Use SERVER_NAME
.
echo $_SERVER['SERVER_NAME']; //Outputs www.example.com
More Related Contents:
- Upvote / Downvote
- Use PHP to render multiple images to the browser [closed]
- Only variables should be passed by reference
- MySQL connection not working: 2002 No such file or directory
- Calling closure assigned to object property directly
- How to mathematically evaluate a string like “2-1” to produce “1”?
- Declaration of Methods should be Compatible with Parent Methods in PHP
- PHP: Regex to ignore escaped quotes within quotes
- PHPMailer: SMTP Error: Could not connect to SMTP host
- how to create virtual host on XAMPP [duplicate]
- Implode a column of values from a two dimensional array [duplicate]
- How do I display a MySQL error in PHP for a long query that depends on the user input? [duplicate]
- PHP get start and end date of a week by weeknumber
- Convert PDF to HTML [closed]
- How to get Insert id in MSSQL in PHP?
- CodeIgniter MSSQL connection
- Jquery – Uncaught TypeError: Cannot use ‘in’ operator to search for ‘324’ in
- Convert a String into an Array of Characters
- What is the advantage of using try {} catch {} versus if {} else {}
- Do I need to escape backslashes in PHP?
- onbeforeprint() and onafterprint() equivalent for non IE browsers
- PHP – How to build tree structure list?
- PHP – add item to beginning of associative array [duplicate]
- How to use events in yii2?
- HREF=”” automatically adds to current page URL (in PHP). Can’t figure it out
- PHP: fopen() Permission denied
- How to pass parameters from bash to php script?
- php mail function: legitimate mails marked as spam by gmail and hotmail
- PHP get the last 3 elements of an associative array while preserving the keys?
- Laravel – DecryptException: ‘The MAC is invalid’