Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get site url with protocol in php

function siteURL() {
  $protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || 
    $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
  $domainName = $_SERVER['HTTP_HOST'];
  return $protocol.$domainName;
}
Comment

PREVIOUS NEXT
Code Example
Php :: php include file in parent directory 
Php :: laravel latest() 
Php :: laravel session forget 
Php :: unique value when two columns laravel migration 
Php :: laravel get all vendor files 
Php :: destroy session php 
Php :: laravel carbon human readable 
Php :: Check duplicate email in laravel using jQuery validation 
Php :: php get client ip 
Php :: how to add property to the request object 
Php :: make model controller in single command 
Php :: wordpress print post data 
Php :: yii2 htpp client form data 
Php :: wp_mail html content 
Php :: how to run laravel project 
Php :: opencart add custom description meta tag using controller file 
Php :: number validation in jquery 
Php :: string to bool php 
Php :: first letter capital of every word in php 
Php :: laravel get parameters from request 
Php :: php JSON_PRETTY_PRINT and ? 
Php :: php datetime create 
Php :: php how to convert string to int 
Php :: wp override home url with php 
Php :: cast string to int php 
Php :: phpspreadsheet password protected 
Php :: php length of array 
Php :: Remove product (item) from WooCommerce checkout page using AJAX 
Php :: check php version linux terminal 
Php :: forelse laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =