Answers for "php get path from url"

PHP
2

php get url path name

parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH );
Posted by: Guest on November-04-2020
1

if browser url is having query string after domain name in it check using php

$url = $_SERVER['REQUEST_URI'];

if (!strpos($url,'mysql')) {
echo 'No mysql.'; //swapped with other echo statement
} else {
echo 'Mysql exists.';
}
Posted by: Guest on December-04-2020
0

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
Posted by: Guest on October-06-2020
0

php parse url get path

parse_url($url, PHP_URL_PATH)
Posted by: Guest on July-26-2021

Browse Popular Code Answers by Language