-->

How to run in php

  • Php file contains html tags and php script it id easy to create simple php code.
  • Save extension.

php syntax

Starting tag <?php

    ending tag ?>

Simple example

</DOCTYPE>

<html>

<body>

<?php echo "<h2>Hello php</h2>" ; ?>

</body>

</html>

PHP using tools

  • Any editor example(Notepad,Notepad ++,Dreamweaver,sublime,visual studio.
  • This php.file save extension(.php).
  • If using server xampp go to the htdocs creating folder and save.the file with extension(php).

Php Case Sensitivity

  • In php, keyword(example) echo,if,else,while)functions user-defined functions, classes are not case-sensitive.
  • All variable names are case-sensitive.
<!DOCTYPE>
<html>
<body>
<?php echo 'hello'</br> ; ?>
<?php echo 'hello world'</br> ; ?>
</body>
</html>

Php print statement can be used to print 

1.String
print "Hello";
2.Multiline strings
print "This is php programming language";
3.Escaping characters
\n
4.Variable
$a="hi";
5.Array
$a=[1,2,3,4];

Things to Recap
1.php file extension.
2.What is string?
3.What is multiline strings?
4.Escaping characters?
5.What is meant by Array?
6.Variable is denoted by the symbol?


Thanks for your view..Keep supporting..

Post a Comment

0 Comments