New course! Every coder should learn Generative AI!
Try a free lesson0
If we want to use global variable ina a function, is there any way?
1 Answer
0
use global key word inside function. like
$var1 = 'my var';
function glbvar(){
global $var1;
echo $var1;
}