Heim  >  Fragen und Antworten  >  Hauptteil

Sie können $GLOBLAS nicht verwenden, um externe Variablen innerhalb einer Funktion zu ändern!!

<?php

$hongniu = 'Ich bin ein Soldat vom einfachen Volk';

function test()

{

echo 'Testfunktion ausgeführt<br />';

$GLOBLAS[ 'hongniu'] = 'Es macht Spaß, anderen zu helfen~! ';

}

test();

echo $hongniu;

?>


speltyspelty2622 Tage vor1687

Antworte allen(2)Ich werde antworten

  • phpcn_u10728

    phpcn_u107282017-07-21 10:01:50

    他们服务器有问题了吧,表示在本地服务器上运行结果是正确的啊QQ截图20170721100111.png

    Antwort
    1
  • spelty

    spelty2017-07-19 23:09:18

    我去,输错单词了。global才是正确的。GLOBLAS

    Antwort
    0
  • ringa_lee

    哈哈,还是得细心哈

    ringa_lee · 2017-07-20 09:03:23
  • StornierenAntwort