RsD0p9BK
12/1/2015 - 3:52 AM

includeFileWithVariables.php

// How to pass arguments to an included file?

function includeFileWithVariables($fileName, $variablesArray) {
  extract($variablesArray);
  include($fileName);
}

$my_header = 'aaaaaaaaaaaaaaaaaaaa';
include 'header.php';

// http://stackoverflow.com/questions/4315271/how-to-pass-arguments-to-an-included-file