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

get_file_contents执行PHP部分

I am trying something like this:

$content = get_file_contents("abc.file");
echo $content;

The problem is that abc.file contains some HTML tags along with a php statement:

<?php require_once('a_php_file.php') ?>

How do I get the server to execute the php parts of abc.file before it being echo(ed).

Thanks!

Use include(): you might need to make some php configuration changes to let include work on remote files, but typically that's what you do.

Either that or eval(), I think.

Use include:

include 'abc.file';

近期文章

  • 处理子节点和PHP foreach的混合列表
  • 在CakePHP中创建变量时需要VAR,我以为VAR被弃用了吗?
  • 陷入正则表达式我不知道是否有可能使用php preg_match_all
  • 我想进行查询,从几个表中检索多个列
  • YUI数据表错误排序
  • Mysql:查询没有执行
  • 外部站点使用Drupal 7进行身份验证
  • Zend从uri获取模型ID
  • 表格帖子上的白色屏幕
  • 将内容添加到变量
  • 比较字符串中关键字的流行度
  • 通过PHP从ajax访问MySQL数据库
  • Jquery AJAX:刷新<article>关于成功的内容?
  • 在某些版本的Chrome中,无法使用Javascript更改图像的src
  • 通过延迟将循环过程分解成部分,需要建议
  • Joomla模板覆盖最新的类别文章
  • jQuery或PHP - 如果启用/禁用了另一个DIV,则显示/隐藏DIV或LI
  • 如何在PHP中创建此数组?
  • 如何为具有多对多关系的业务目录设置mySQL表结构?
  • C语言AES求大佬帮助?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华