module global

<?php
//module_caller.php
require_once('test_module.php');

test();
if(2>1)
{
  global $g_analysis_error;
  echo $g_analysis_error;
}

 

<?php
//test_module.php
global $g_analysis_error;
function test()
{
   global $g_analysis_error;
   $g_analysis_error="hi world!";
}
?>

 

posted @ 2017-06-22 15:28  sky20080101  阅读(82)  评论(0)    收藏  举报