找回密码
 免费注册

php中返回页面结果

[复制链接]
发表于 2022-11-24 10:29:46 | 显示全部楼层 |阅读模式
test.php

  1. <?php
  2. return array('name'=>'tom','sex'=>'男');
复制代码
6-demo.php

  1. <?php
  2. $stu=require './test.php';
  3. print_r($stu);  //Array ( [name] => tom [sex] => 男 )
复制代码
小结:在项目中引入配置文件就使用这种方法

QQ|Archiver|小黑屋|网站地图|深圳市金黑网络技术有限公司 ( 粤ICP备2021124338号|粤公网安备 44030702003689号 )

GMT+8, 2026-8-8 17:13 , Processed in 0.042887 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表