php get url path name
parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH );
php get url path name
parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH );
php get domain from url
$url = 'http://google.com/dhasjkdas/sadsdds/sdda/sdads.html';
$parse = parse_url($url);
echo $parse['host']; // prints 'google.com'
php get hostname
<?php
echo gethostname(); // may output e.g,: sandie
// Or, an option that also works before PHP 5.3
echo php_uname('n'); // may output e.g,: sandie
?>
php get domain name with https
echo $_SERVER['SERVER_NAME']; //Outputs www.example.com
part of url php
//https://www.google.com/search?key=1234
$url = $_SERVER['REQUEST_URI'];
$url_components = parse_url($url);
parse_str($url_components['query'], $params);
$key = $params['key'];
// key=1234
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us