Answers for "access php global variable in another php file"

PHP
0

php set global variables from function

<?php 
function setGlobalVariable() {
    $GLOBALS['variable_name'] = "Some Value";
}
setGlobalVariable();
echo $variable_name;
// Outputs: Some Value
Posted by: Guest on September-10-2021

Code answers related to "access php global variable in another php file"

Browse Popular Code Answers by Language