34 785
modifications
(→Déclaration de fonction : Il s'agit ici d'expliquer comment "définir" une fonction (donner son code) et non de la "déclarer".) |
mAucun résumé des modifications |
||
//-- fichier 1 : les variables globales (mot clef '''global''')
global $var1 = "Salut";
</syntaxhighlight>
}}
//-- fichier 2 : les traitements
echo "J'utilise ma variable globale : ".$GLOBALS['var1']; //-- Récupération via $GLOBALS
</syntaxhighlight>
}}
echo __NAMESPACE__;
}
</syntaxhighlight>
require 'TestNS.php';
Projet1\SousProjet2\Fonction1();
</syntaxhighlight>
|
modifications