0

Why i get error

$num1 is a global variable, isn't it ? https://code.sololearn.com/wGC5SPcyq1Vp/?ref=app

28th Apr 2018, 4:19 PM
Ariful Islam
Ariful Islam - avatar
5 Respuestas
+ 2
have to change the global declaration
30th Apr 2018, 7:11 AM
Jyothirani
Jyothirani - avatar
+ 2
<?php $num1 =56; function my_func() { $_GLOBALS['num1'] = 86; } my_func(); echo $num1; ?>
30th Apr 2018, 7:13 AM
Jyothirani
Jyothirani - avatar
0
The first line must be <?php not just php
28th Apr 2018, 4:24 PM
Ariela
Ariela - avatar
0
Here <?php $num1 =56; function my_func() { $num1=89; echo $num1; } my_func(); ?>
28th Apr 2018, 4:25 PM
Ariela
Ariela - avatar
0
thanks #ariela #jothin rain
30th Apr 2018, 8:18 AM
Ariful Islam
Ariful Islam - avatar