Basic include() example

Related documents:

  1. http://php.net/manual/en/function.include.php
  2. http://forum.arvixe.com/smf/general/php-script-errors/

vars.php:

<?php
$color = ‘green’;
$fruit = ‘apple’;
?>

index.php:

<?php
define(‘BASE_PATH’,’c:/hostingspaces/shai/shai-arvixe.com/wwwroot/’);
include BASE_PATH . ‘inc/vars.php’;
echo “A $color $fruit”; // A green apple
?>

Result and expected output:

A green apple

Tags: , , , , | Posted under DotNet/Windows Hosting | RSS 2.0

Leave a Reply

Your email address will not be published. Required fields are marked *


4 − = 2

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>