i
PHP Variables
PHP Data Types
PHP Echo & Print
PHP Strings
PHP Numbers
PHP Constants
PHP Operators
PHP if...else...elseif Statements
Switch Statement
PHP Loops
PHP Arrays
Superglobals
PHP Coding Standards
PHP Form Handling
PHP Form Validation
PHP URLs Validation
PHP Form Required Validation
Complete Form Example
PHP File Functions Open/Read
PHP File Create/Write
PHP File Upload
PHP Cookies Handling
PHP Session Handling
PHP filter_var() Function
PHP Validation Filters
PHP Sanitization Filters
Using Filters
Filters Advanced
JSON
PHP Date and Time
MySQL Database
MySQL Connect
MySQL Commands-Creating a Table
MySQL Commands-Inserting The data
MySQL Commands-Prepared Statement
MySQL Commands-Selecting The Data
MySQL Commands-Where and Order By
MySQL Commands-Deleting And Updating The Data
PHP-OOP Introduction
PHP-Classes/Objects
PHP-Constructor/Destructor
PHP-Access Modifiers
PHP-Inheritance
PHP-Inheritance and Protected Access Modifier
PHP-Overriding Inherited Methods
PHP-Final keyword
PHP-Abstract Classes
PHP-Constants
PHP-Traits
PHP-Static Methods and Properties
Introduction to Functions
Defining A function
Returning Values From A Function
Dynamic Function Calls
Variable Scope
Understanding Arguments Or Parameters
Testing For A Function Existence
Returning Multiple Values From A Function
Making practical Use By Building Code Libraries For Code Re-usability
Using Include() And Require()
Comments are the set of lines that need not be executed. A comment in PHP code is not executed as the part of the program and is for understanding purpose only. Like if someone is reading the code, he should be able to understand the motive of writing those set of commands.
>Need of comments
· To let people understand your code or statements.
Help you recall the developing purpose as developers might forget the code purpose after a year or two and comments can help in that time.
>Single Line Comments
There are two ways to mark the statement as a single line comment. One is //, and the other is #.
For example –
// It is a single line comment in PHP.
# This is also a single line comment in PHP.
>Multi-Line Comments
The syntax for using multi-line comments is /* */, and you can use this syntax in between the script also to comment some portion of the statement.
For example –
/* I do not want to display these lines
So, I have created a multiple-lines comment block
That will not give output
*/
Another example when we use multi-line comment inside a statement the output will ignore the comment and display the result.
$x = 5 /* + 15 */ + 5;
echo $x;
?>
The output of this php script will be 10.
Don't miss out!