我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在包含文件中使用变量[重复]

This question already has an answer here:

  • Reference — What does this symbol mean in PHP? 18 answers

Is it possible to include files with a variable inside of include?

See this example:

$randfilescnt = rand(1,$filecount);

include('./quizes/Arrow/quiz'+ $randfilescnt +'.php');

How can I do this?

</div>

Use "." for string concat in php

 $randfilescnt = rand(1,$filecount);

    include('./quizes/Arrow/quiz'.$randfilescnt.'.php');

Like this way :

$randfilescnt = rand(1,$filecount);
include("./quizes/Arrow/quiz".$randfilescnt.".php");

近期文章

  • 如何将整数和字符串作为参数发送给JsonObjectRequest(Android)
  • 如何将日期更改为此格式?
  • 控制器中的构造函数如何重写为提供者?
  • 在php中查找意图连接函数
  • PHP升级后无法连接到外部Mysql
  • 在PodioAppField :: update上保留字段位置
  • Wordpress阅读旧版本的php文件,打破网站
  • 如何添加一个新的paypal sdk文件已经存在于php中的另一个paypal sdk文件autoload.php
  • 如何替换除文本以外的所有内容[重复]
  • Laravel Advanced Having
  • 在Ajax Success重载表上
  • 在Cakephp 3中捕获致命错误
  • PHP执行python脚本
  • Objective-C正则表达式
  • PHP循环输出重复
  • 提交后PHP重定向到HTML页面[关闭]
  • 跟踪Yii2中的Web应用程序使用情况
  • 隐形reCAPTCHA缺少输入响应
  • 如何使用PHP将链接转换为按钮?
  • PHP在<script type =“text / javascript”> </ script>中获取内容

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华