php server port code example
Example 1: php server name
echo $_SERVER['PHP_SELF'];
echo "<br>";
echo $_SERVER['SERVER_NAME'];
echo "<br>";
echo $_SERVER['HTTP_HOST'];
echo "<br>";
// echo $_SERVER['HTTP_REFERER'];
echo "<br>";
echo $_SERVER['HTTP_USER_AGENT'];
echo "<br>";
echo $_SERVER['SCRIPT_NAME'];
Example 2: how to serve the port in php
php artisan serve --port=portNumber
// Example with port
php artisan serve --port=8001
// Note: You May choose anyport you want