简体   繁体   English

使用php从动态.txt文件获取内容

[英]get content from dynamic .txt file using php

I am using: 我在用:

<?php

$file = file_get_contents("currentstate.txt","r");
echo($file);

?>

to display contents of a txt file in a modal window upon request. 根据要求在模式窗口中显示txt文件的内容。

The contents of the txt file is dynamic but the php only displays the content as it is when the page was loaded. txt文件的内容是动态的,但php仅在加载页面时按原样显示内容。 I need a way to update what the php displays without refreshing the page. 我需要一种无需刷新页面即可更新php显示内容的方法。

TIA TIA

您将需要ajax或Jquery来完成此任务

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM