search

Home  >  Q&A  >  body text

You cannot use $GLOBLAS to change external variables inside a function!!

<?php

$hongniu = 'I am a soldier, from the common people';

function test()

{

echo 'Executed TEST function<br />';

$GLOBLAS['hongniu'] = 'Helping others is very happy~! ';

}

test();

echo $hongniu;

?>


speltyspelty2693 days ago1732

reply all(2)I'll reply

  • phpcn_u10728

    phpcn_u107282017-07-21 10:01:50

    There must be a problem with their server. It means that the result of running on the local server is correctQQ截图20170721100111.png

    reply
    1
  • spelty

    spelty2017-07-19 23:09:18

    Here I go, I entered the wrong word. global is correct. GLOBLAS

    reply
    0
  • ringa_lee

    Haha, you still have to be careful.

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