knowledgediarybd.com

Your Virtual Knowledge Campus







How To Instal PHP & PHP Syntax

php install and php syntextTo do work with PHP first of all you have toInstal PHP   .if you have no server supports PHP. But If your  server supports PHP then you have no need to do anything.

Just create a PHP file Like:  example.php in htdocs or in your web directory then save and finally write on browser:http://localhost/eexample.php then Go.

If you have no server supports PHP you have to  Instal PHP first  . you can Instal PHP From

the several following links:

How to install PHP5 from  PHP.net : http://www.php.net/manual/en/install.php

  Free download PHP

form here:

http://www.php.net/downloads.php

Free download Apache

form  here:

http://httpd.apache.org/download.cgi

 free download MySQL

form   here:

http://www.mysql.com/downloads/

PHP Coding Syntax:

PHP script all time  starts with <?php and ends with  ?>.

and PHP script can be placed anywhere in the document.

Basic  PHP Syntax:

<?php

Content have to write here.
?>

 .php extension  must have in  a PHP file.

PHP file generally  contains HTML tags  and some PHP scripting code.

Example of PHP code:

<html>

<body>

<?php

echo “Well come to PHP Tutorials”;

?>

</body>

</html>

Normally two basic   statements are used to show the output text in PHP:

1. echo and

2. print.

In the above  example we have used the echo statement to  show the output the text “Well come to PHP Tutorials“. rather than print.

Every statement or  code line in PHP must end with a semicolon.

 PHP Comments:

In PHP generally we use // symbol to denote  a one-line comment and

/* and */  symbol to make a block comment :

For Example:

<html>
<body>

<?php
//This is  a single-line  comment

/*
This is
a comment
block
*/
?>

</body>

</html>

Related Post:

knowledgediarybd.com © 2017
shares