亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

js如何調用php文件內顯示的數值到html?

js如何調用php文件內顯示的數值到html?

心有法竹 2018-07-13 13:15:45
目前有兩個文件,一個是index.html,另一個是code/index.php我想以api的形式,用js將code/index.php內的數值顯示到index.html內支持jq和ajax輪詢,但是不太會寫另附code/index.php代碼求詳細解答  <?php $data=file("date.txt"); $ini=0; $p= rand(10, 99); if(count($data)){  $data=explode(",",$data[0]);   $now=date("Y-m-d H:i:s");   $second=floor((strtotime($now)-strtotime($data[0]))%86400);   $ini=$data[1];  if($second>=35){   $fp=fopen("date.txt","w");   $str=date("Y-m-d H:i:s").",".($data[1]+$p);   fputs($fp,$str);   $ini=$data[1]+$p;  } }else{  $fp=fopen("date.txt","w");  $str=date("Y-m-d H:i:s").",".$ini;  fputs($fp,$str); } echo $ini; ?>
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 1302 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號