“Obtenga un enlace de URL en PHP” Código de respuesta

PHP Obtener nombre de ruta de URL

parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH );
Yoshkinawa

Cómo obtener el enlace de la página actual en PHP

<?php  
    if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')   
         $url = "https://";   
    else  
         $url = "http://";   
    // Append the host(domain name, ip) to the URL.   
    $url.= $_SERVER['HTTP_HOST'];   
    
    // Append the requested resource location to the URL   
    $url.= $_SERVER['REQUEST_URI'];    
      
    echo $url;  
  ?> 
Wild Weasel

Obtenga un enlace de URL en PHP

actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
adriendums

Obtenga URL con PHP

$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Smiling Stag

Respuestas similares a “Obtenga un enlace de URL en PHP”

Preguntas similares a “Obtenga un enlace de URL en PHP”

Más respuestas relacionadas con “Obtenga un enlace de URL en PHP” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código