像Delphi中的Uses和C/C++等中的include一样,PHP中有require和include来表示引用单元.

如果在一个php文件中引用了一个单元,比如:

require(“test.php”);

test.php是这样定义的:

<?php

echo “hello,引用了test.php”;

function test($var)

{

echo $var ;

}

?>

则test.php中的

echo “hello,引用了test.php”;

将被直接显示,而函数test($var)则可以在引用的单元中调用.

相关文章:

  • 2022-02-23
  • 2021-06-02
  • 2022-12-23
  • 2021-07-02
  • 2021-07-10
  • 2021-10-09
  • 2022-12-23
  • 2021-11-17
猜你喜欢
  • 2022-01-20
  • 2022-12-23
  • 2022-02-27
  • 2021-09-19
  • 2022-12-23
  • 2021-08-06
  • 2021-12-13
相关资源
相似解决方案