字符串$test1, $test2,$test3和$test4在函数中创建test()。我怎样才能打印她?
我的代码:
配置文件
<?php
function test(){
$test1 = 'test1 string';
$test2 = 'test2 string';
$test3 = 'test3 string';
$test4 = 'test4 string';
}
?>
测试.php
<?php
require_once("conf.php");
test();
echo $test1;
echo $test2;
echo $test3;
echo $test4;
?>
为什么代码不起作用?
为什么没有$test1, $test2, $test3, 和$test4打印。
PS:最好没有全局参数。