打開一個txt文件,將Php文件拖進去,再用另存為txt文件保存。保存完在把下一個Php文件拖進來。。。。如此反復便可. 直接修改文件格式就可以,將擴展名.php修改成.txt
成都創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供陳巴爾虎網(wǎng)站建設、陳巴爾虎做網(wǎng)站、陳巴爾虎網(wǎng)站設計、陳巴爾虎網(wǎng)站制作等企業(yè)網(wǎng)站建設、網(wǎng)頁設計與制作、陳巴爾虎企業(yè)網(wǎng)站模板建站服務,10年陳巴爾虎做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡服務。
//記錄返回值
? ? $write_data_a = [
? ? ? ? 'html_url'? =? $getUrl,
? ? ? ? 'ip'? ? = $this-get_real_ip(),
? ? ? ? 'time'? =? date("Y-m-d H:i:s",time()),
? ? ? ? 'res'?? = $response
? ? ];
//轉(zhuǎn)化為JSON
? ? $write_data_a = json_encode($write_data_a) . '||' . "\n";
? ? $date = date("Y-m-d", time());
//項目路徑目錄,判斷是否存在,不存在則創(chuàng)建
? ? $lujing = "./360_mobile_res_sd";
? ? if(!is_dir($lujing)){
? ? ? ? mkdir(iconv("UTF-8", "GBK", $lujing),0777,true);
? ? }
//文件,判斷是否存在,不存在則創(chuàng)建
? ? $TxtFileName = "./360_mobile_res_sd/" . $date . "_2.txt";
? ? //以讀寫方式打?qū)懼付ㄎ募?,如果文件不存則創(chuàng)建
? ? if(file_exists($TxtFileName))
? ? {
//存在,追加寫入內(nèi)容
? ? ? ? file_put_contents($TxtFileName, $write_data_a, FILE_APPEND);
? ? }
? ? else
? ? {
//不存在,創(chuàng)建并寫入
? ? ? ? if( ($TxtRes=fopen ($TxtFileName,"w+")) === FALSE){
? ? ? ? ? ? exit();
? ? ? ? }
? ? ? ? if(!fwrite ($TxtRes,$write_data_a)){ //將信息寫入文件
? ? ? ? ? ? fclose($TxtRes);
? ? ? ? ? ? exit();
? ? ? ? }
? ? ? ? fclose ($TxtRes); //關(guān)閉指針
? ? }
在桌面點右鍵新建文件,“新建”——————“文本文檔”,把php里面的內(nèi)容復制進去就行了。就變成TXT文本了 我是宏采納我
是需要復制文件,例如c:\a.txt復制到d:\b.txt,使用下面的語句:
copy('c:/a.txt', 'd:/b.txt');
新聞名稱:php數(shù)據(jù)生成txt的簡單介紹
鏈接地址:http://jinyejixie.com/article42/ddoiphc.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設計、網(wǎng)頁設計公司、Google、微信小程序、外貿(mào)網(wǎng)站建設、網(wǎng)站改版
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)