第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

從文本文件目錄中讀取文件內(nèi)容時(shí),文本文件中的單獨(dú)換行符(新行向下)

從文本文件目錄中讀取文件內(nèi)容時(shí),文本文件中的單獨(dú)換行符(新行向下)

PHP
慕工程0101907 2021-07-05 10:55:15
我需要在輸出中的一組文本文件中分隔換行符。目前,我們可以分塊顯示網(wǎng)頁(yè)上文件夾中的所有文本文件,但是文本數(shù)據(jù)組合在文本塊中,我想學(xué)習(xí)如何識(shí)別換行符并將顯示的內(nèi)容向下移動(dòng)一兩行創(chuàng)建一個(gè)易于閱讀的分隔符。我沒(méi)有嘗試任何東西,因?yàn)槲覍?duì)如何識(shí)別換行符并顯示它感到困惑。$directory = "feeds/";$dir = opendir($directory);while (($file = readdir($dir)) !== false) {  $filename = $directory . $file;  $type = filetype($filename);  if ($type == 'file') {     $contents = file_get_contents($filename);     $items = explode('/n', $contents);     echo '<table width="100%" border="1" cellpadding="4" bgcolor="#fff">';     foreach ($items as $item) {       echo "<tr><td>$item</td></tr>\n";     }     echo '</table>';  }}closedir($dir);?>```Output at the moment is this@mpgradio - Mark Rogers - Imagining playing on MPG Radios.. Innovative Music Mix - http://www.mpgradio.ca/radio/imm/ Your music could be included in our rotations, just reach out to us. @lacroix_gen - Gen Lacroix - l’extase de l’oubli playing on MPG Radios.. Reflection Town - http://www.mpgradio.ca/radio/rt/ Where you have the opportunity to listen to unsigned independent artists.Expected output is would be something like.@mpgradio - Mark Rogers - Imagining playing on MPG Radios.. Innovative Music Mix - http://www.mpgradio.ca/radio/imm/ Your music could be included in our rotations, just reach out to us.@lacroix_gen - Gen Lacroix - l’extase de l’oubli playing on MPG Radios.. Reflection Town - http://www.mpgradio.ca/radio/rt/ Where you have the opportunity to listen to unsigned independent artists.
查看完整描述

2 回答

?
holdtom

TA貢獻(xiàn)1805條經(jīng)驗(yàn) 獲得超10個(gè)贊

<?php

$directory = "feeds/";

$dir = opendir($directory);

while (($file = readdir($dir)) !== false) {

$filename = $directory . $file;

$type = filetype($filename);

if ($type == 'file') {

$contents = file_get_contents($filename);

$items = explode('\n', $contents);

echo '<table width="100%" border="1" 


cellpadding="4" bgcolor="#fff" id="rcorners">';

foreach ($items as $item) {

**echo"<tr><td id='rcorners'>".nl2br

($item)."</td></tr>\n";**


}

echo '</table>';

}

}

closedir($dir);

?>


查看完整回答
反對(duì) 回復(fù) 2021-07-09
  • 2 回答
  • 0 關(guān)注
  • 234 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)