In: Computer Science
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
This demonstration is using WAMP server.
Here a new php file with name "myFirstPHP.php" is created, which contains following code.
myFirstPHP.php :
<?php
//This is comment
//This is my first PHP document, which displays some data in the web browser
$myName="Virat";//name
$randomNumber=53870;//randomNumber
//assigning web browser name and operating system name
$userAgent="Web browser : Google Chrome ,Operating system : Windows 10<br/>";
//file name
$fileName=" myFirstPHP.php";
//ip address
$ipAddress="192.168.43.1";
//display each variable
echo "My Name is ".$myName."<br/>";//display $myName
//print random number
echo "Random Number : ".$randomNumber."<br/>";
//display web browser name and operating system name
echo $userAgent;
//display if address
echo "Ip Address : ".$ipAddress."<br/>";
?>
======================================================
Output : Run php file myFirstPHP.php through server and will get the screen as shown below
Screen 1 :myFirstPHP.php
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.