Answers for "wordpress global variable not working"

PHP
0

wordpress global variable not working

global $g_value;  
//declare it global even before assigning it., this should fix it.

$g_value = 'something';
echo $g_value;

function get_value() {
    global $g_value;
    print $g_value;
}

echo get_value();
Posted by: Guest on February-05-2021

Code answers related to "wordpress global variable not working"

Browse Popular Code Answers by Language