La portée d’une variable globale

Author:


Download

  <?php

   $pays= "US";
function test( )
     {
            $GLOBALS['pays'] = "france";
    }

    echo "Avant la modfication de la variable globale,
            'pays'=$pays<br/>";
    // La variable globale modifiée dans la fonction
    test( );
    //
    echo "Après la modfication de la variable globale
            'pays'=$pays";

    ?>

Leave a Reply

Your email address will not be published. Required fields are marked *


2 × = twelve