0
Why i get error
$num1 is a global variable, isn't it ? https://code.sololearn.com/wGC5SPcyq1Vp/?ref=app
5 Respuestas
+ 2
have to change the global declaration
+ 2
<?php
$num1 =56;
function my_func() {
$_GLOBALS['num1'] = 86;
}
my_func();
echo $num1;
?>
0
The first line must be <?php not just php
0
Here
<?php
$num1 =56;
function my_func() {
$num1=89;
echo $num1;
}
my_func();
?>
0
thanks #ariela #jothin rain