php include file from another folder

Today, We want to share with you php include.In this post we will show you PHP require_once, include_once() statement, hear for php include_once we will give you demo and example for implement.In this post, we will learn about PHP Include and Require commands with an example.

How to Make Your PHP include File and Gain Functionalities?

PHP Includes:– PHP includes keyword is used to import a php file into another second file of the same as root folder. This reduces time as well as rewriting of access code instead of copy as well as paste strategy. Therefo i recommend to use this includes keyword to evaluate a specific php file which you required to includes in your file.

Example of PHP Include//profile.php

Example 1:


Example 2: Illustration of header.php file.


Usage of Statements: Examples

  
        
      

Welcome! - www.pakainfo.com

use the PHP includes statement:

footer.php

  
      
    

Welcome! - www.pakainfo.com

Text line.

Texty text line.

PHP include() Statement

Syntax:

include('name of the php file with path');

File get_product_info.php:


File index.php, which includes get_product_info.php :


Results

I Virat Mobile  than Laptop

I hope you get an idea about PHP Includes and Require (php require file in different directory).
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment