Implementation of the include statement

I wrote a simple code: include.php

<?php
include "settings.php"; 
$c = $a+$b;
echo "  - $c";
?>

In the settings.php file, as expected, I created 2 variables with some values:

<?php 
$a = 10;
$b = 15;
?>

But as a result, nothing happened – when I ran include.php – nothing was displayed in the browser. Tell me, please, where did I go wrong? Thank you.


Answer 1

//settings
<?php
$a = 10;
$b = 15;
?>
//include
<?php
include('settings.php');
$c = $a + $b;
echo '  - '.$c;
?>

And a tip, use include as little as possible.