标签: php
我的include.php:
<h1><?= $sample ?></h1>
这项工作:
$sample = "Hello World"; include 'include.php'; //
但这不起作用:
$sample = "Hello World"; function sampleInclude($inc) { include $inc; } sampleInclude('include.php');
它说:
未定义变量$sample
$sample
为什么?