php claims my defined variable is undefined

后端 未结 4 1972
北海茫月
北海茫月 2020-12-19 03:27

My php is a little rusty but this is boggling my mind right now. I googled this and read all the stackoverflow questions I could find that looked related, but those all seem

4条回答
  •  忘掉有多难
    2020-12-19 04:06

    if you don't want to use globals, you can jast use

     function add_msg($msg)
       {
             echo  "
    $msg
    "; } add_msg("test"); add_msg("test2");

    function, the result will be the same.

提交回复
热议问题