PHP Tutorial Part-1 || Basic PHP Syntax, PHP Comments

in Hindwhale Community3 days ago


Photo Make with Canva

Hello friends, how are you all? Hope everyone is well. I'm fine too. I am going to launch PHP tutorial series for those who are programming and good at programming or want to learn programming. Hope you like it and your encouragement is greatly appreciated.


Today's point is

  • Fundamental PHP Syntax
  • PHP Comments

Basic PHP Syntax

A PHP script can be put wherever in the document.
The default record extension for PHP records is ".php".
A PHP record frequently contains HTML names, and a few PHP scripting code.

Below, we have an outline of a fundamental PHP record, with a PHP script that businesses a built-in PHP work "resonate" to surrender the substance "Hello there World!" on a web page:

Example:

PHP Case Sensitivity

In PHP, catchphrases (e.g. on the off chance that, else, while, resound, etc.), classes, capacities, and user-defined capacities are not case-sensitive.

In the case underneath, all three reverberate clarifications underneath are break indeed with and legal:

Example:

Comments in PHP

A comment in PHP code is a line that is not executed as a portion of the program. Its as it were reason is to be perused by somebody who is looking at the code.

Comments can be utilized to:

Let others get it your code
Remind yourself of what you did - Most software engineers have experienced coming back to their claim work a year or two afterward and having to re-figure out what they did. Comments can remind you of what you were considering when you composed the code
Leave out a few parts of your code
PHP underpins a few ways of commenting:
Example:

Single Line Comments

Single line comments begin with //.

Any content between // and the conclusion of the line will be overlooked (will not be executed).

You can moreover utilize # for single line comments, but in this instructional exercise we will utilize //.

The taking after illustrations employments a single-line comment as an explanation:

Comments to Disregard Code
We can utilize comments to avoid code lines from being executed:

Example:

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.028
BTC 62800.25
ETH 2449.72
USDT 1.00
SBD 2.57