> require_once in php ~ Online tutorial

require_once in php

The require_once()statement include and evaluates the specified file during of execution of the script.This is a behavior similar to the require() function with the only difference being that it code from a file has already been included.It will not be included again.

Syntax
include "function name";
Example
vars.php


<?php
$color='red';
$fruit='apple';
echo $fruit."color is".$color"
?>
test.php

<?php
echo "a $color $fruit"
// include 'vars.php
require_once'vars.php'
echo "a $color $fruit"
?>
Output:



Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: