Skip to content

Instantly share code, notes, and snippets.

@bitkorn
Created August 12, 2017 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitkorn/fa7a6d8578ec2bc6a91efd3e615f3873 to your computer and use it in GitHub Desktop.
Save bitkorn/fa7a6d8578ec2bc6a91efd3e615f3873 to your computer and use it in GitHub Desktop.
Get the base url
<?php
$baseUrl = strtolower(substr($_SERVER['SERVER_PROTOCOL'], 0, strpos($_SERVER['SERVER_PROTOCOL'], '/'))) . '://' . $_SERVER['SERVER_NAME'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment