Answers for "php pass varibles to function as global"

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 "php pass varibles to function as global"

Browse Popular Code Answers by Language