用includevars.php
<?php$color = 'green';
$fruit = 'apple';?>test.php
<?phpecho "A $color $fruit"; // Ainclude 'vars.php';echo "A $color $fruit"; // A green apple?>

解决方案 »

  1.   

    不是要包含,我并不是想包含这个文件
    如果A.php中内容是
    <?php
    echo "abc";
    echo "<br>";
    echo "def";
    ?>
    那b.php中的想要的结果是
    变量$a = "abc
    <br>
    def";
      

  2.   

    //b.php//您要用这个函数去get对应这个网址的url就可以了.
    $a = file_get_contents('http://xxxx/xxxx/a.php');
      

  3.   

    先用file_get_contents
    然后再用eval
    你看可以不
      

  4.   

    楼上的方法应该是可以的,你这样为什么不用call_user_func?
      

  5.   

    file_get_contents 行
    file()先行。不过要用http://yourUrl这种形式。。然后读出来就行了。
      

  6.   

    UP
    这样可以获取网页的HTML代码,C#用webrequest
      

  7.   

    http://download.csdn.net/source/615026
    HTTPRequest 类,写采集程序用过的
    一国外网站见过的
      

  8.   

    以上方法可以解决,就是file_get_contents这个函数
    你的url是
    本地文件就是全部内容加上HTTP后就是输入内容
      

  9.   

    a.php中的输出变成变量定义$aa='dfdf',用file_get_contents()读取后,直接赋给b中的变量就可以了