What is the inside and outside | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the inside and outside

in this code. <?php $name = 'David'; function getName() { echo $name; } getName(); ?>

11th Sep 2017, 10:03 AM
stephen haokip
stephen haokip - avatar
1 Answer
+ 1
name is global variable in this code.. so calling getName will echo the value of that global variable.. I don't know if that what you asked for
11th Sep 2017, 12:06 PM
Nour Alhadi Mahmoud
Nour Alhadi Mahmoud - avatar