Code: Select all
function xample() {
require_once 'helper.php';
echo 'Do something with helper.';
}Code: Select all
require_once 'helper.php';
function xample() {
echo 'Do something with helper.';
}Example helper.php:
Code: Select all
$HELPER = "XYZZY";
function helper_function() {
echo "blah blah";
}Code: Select all
function xample() {
require_once 'helper.php';
global $HELPER;
echo 'The value is $HELPER";
}Am I interpreting this right? What are the implications of choosing one over the other? I'm coming from a C/C++ background and this on-the-fly compilation / interpretation stuff is new to me.
Thanks in advance.