如何从其他服务器获取PHP代码并实现到当前页面

I have txt file on server 1, on that txt file i write php and html code like this :

<b>I want to eat <?=$keyword;?></b>

Then on server 2, I want to pull that data and implement to current page on server 2. I try to use this code :

<?
$keyword = 'pizza';
$data = file_get_contents( 'http://www.domain.com/text.txt');
echo $data;
;?>

I want the result on server 2 page will display 'I want to eat pizza' but it just written "I want to eat".
It possible ?
Thank you very much for the answer.

</div>
查看全部
donglu7816
donglu7816
2017/02/07 02:04
  • php
  • html
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复