Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how make a variable global php

$a = 1;
$b = 2;
function Sum(){
    global $a, $b; // allows access to vars outside of function
    $b = $a + $b;
} 

Sum();
echo $b; // output is 3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #variable #global #php
ADD COMMENT
Topic
Name
4+2 =