Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php set global variables from function

<?php 
function setGlobalVariable() {
    $GLOBALS['variable_name'] = "Some Value";
}
setGlobalVariable();
echo $variable_name;
// Outputs: Some Value
 
PREVIOUS NEXT
Tagged: #php #set #global #variables #function
ADD COMMENT
Topic
Name
9+5 =