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()
Include function helps you to handle files on multiple pages in a proper way. It gives you the ability to organize the php files in a better way. Using include function you can use all the files in a single php file when the files are present at multiple locations. Imagine you have created a separate file for header and a separate file for the footer. To get all the multiple files in the homepage or main php file, you can use include function. Include statement includes and evaluates the specific file mentioned after include keyword.
Syntax of include function is include(filename) e.g. include(header.php)
Require function also helps you to handle files on multiple pages and adds the file present at a different location. The filename is given with require() function to get the content of that file in the main page. Required file has to be present to run the php code where require function is used.
Syntax of require function is require(filename) e.g. require(header.php)
The difference between include() and require() is that when a file is not present mentioned after include() keyword it gives error for that file but executes the remaining code but when the file mentioned with require() function is not present, it gives a fatal error and doesn’t run the remaining code.
Don't miss out!