PHP first Page


PHP first Page execution

PHP script will execute on the server. First create the file with name index.php . If you have any confusion that where and how to create the PHP file , or how to install the server on your computer then please visit these below chapter: ⇨PHP server installation tutorial If you have created file in the folder "C://wamp/www/mywebsite" then you can open then you can open the index.php file using wamp server using below URL in your browser. • " http://localhost/mysite/index.php " . Now we are going to write the PHP code the index.php file.

How to display the outputs one or more strings?

Write the below code in your index.php file. <html> <head> <title>How to display one or more string using PHP?</title> </head> <body> <p><?php echo "This is the a paragraph using PHP echo function" ; ?> </p> </body> </html> In the above PHP code we have write some paragraph content using the PHP echo() function. If we are going to paste the PHP output in any heading like h1, h2, h3 then the output will inherit the properties (like size,color,padding etc) of that particular heading . So PHP output will display in between the HTML tags. For example:

Heading using PHP

<h1><?php echo "This is the largest heading using PHP echo function" ; ?> </h1>

Page title using PHP

<title><?php echo "This is the page title using PHP echo function" ; ?> </title>
Chapter Next »