PHPで現在のURLを取得する方法
方法1: $_SERVER変数を使用する方法$currentURL = 'http'; if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') $currentURL .= "s"; $currentURL .= "://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; echo $currentURL;>>More
方法1: $_SERVER変数を使用する方法$currentURL = 'http'; if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') $currentURL .= "s"; $currentURL .= "://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; echo $currentURL;>>More