当前url:http://localhost:805/test/helloworld.php
echo 'SERVER_NAME:'.$_SERVER['SERVER_NAME']; //获取当前域名(不含端口号)
echo '<p>'; echo 'HTTP_HOST:'.$_SERVER['HTTP_HOST'];//获取当前域名 (含端口号)
echo '<p>'; echo 'REQUEST_URI:'.$_SERVER['REQUEST_URI'];//获取当前域名的后缀
效果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWUAAACeCAIAAABlxYyCAAAbDElEQVR4nO2dW2wb2XnH+ZKX9KkvfFSf9FY/tNKiwVaA0URI21DoQwik6wFSGJLhgu0CAYOtJaEoPC6glotaZSI3SzBZ000aMrte0psqy105Ea21SwI2ll1nyVVAhcmy4ZYr7XBtKQeSS4mWvj7MhXM7Z84Mh7pY3w8HAufMzHe+c/ufywypAEFUHjx4cOfOnd3dXUAQxI7AUXfSY8StW7dQLBCEAepFj9dff/2oqwNBjjWoFz0GpBcjSQwYjntAvXAN6gWGUxtQL1yDeoHh1Aaf9WJ9fX16enp6etrfLrq2tra2tra1tdW/qfX19UwmMz09LQiCIAjT09Ovvvrq+vq6fHZhYcHRgqNebG9v53K52dlZOYnZ2dlcLre9vY16geGkBz/1QhYLQRAuXbrUT5e2sra2Vq1W+5eM27dvX7hwQbBw4cKF27dvLywsCILgaIStF3fv3pWTmJ+fz2az2Wx2fn5eTuLu3btsvSh3gLR8reAaAMBicjDGrSEPZaJkp9OB7HLvVLoFHS0+r0RebRmLoANXTQYXoQVQWx2Mt6rxqy27pJmhAdComUv4cALDW7cZ8ZBx3/RCLxbacO0XW1tb/UvG7du3ZXVYWFhYXV2VI1dXV2WZ0HC0w9CLu3fvCoIwMzMjSZI+XpKkmZkZQRDee++9E68XFSBd+x5S2gEgMJeFkSwsbQLswGWtXXZhadkuntleLzcBurCQhJEkVDpqF/XJYc046gV/6v7oxUDFQqZPyVhfX5eH/du3b1vPXr58uX+92N7evnDhwszMjBYjG9QOZ2ZmLly4QFuYjJwUvaD3kF4vMl5WA2jV1fgVaANU7nO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