php?去掉空格解決辦法

來源:互聯網
上載者:User
php?去掉空格

[content_sc] =>
商號名稱(中文): 有限公司
商號名稱(英文):
商號地址: 廣州市
經營項目: 金銀幣,硬幣,紙幣,郵票,趣味品,茶品
聯絡人姓名(中文): 張三
聯絡人姓名(英文):
電話 123232328899
傳真: QQ23232370566
網址:
電郵: [email protected]

$row['content_tc'] = str_replace('', '', $row['content_tc']);
我用str_replace 替換空格,然而並沒有什麼卵用


想要的效果
[content_sc] =>
商號名稱(中文):有限公司
商號名稱(英文):
商號地址:廣州市
經營項目:金銀幣,硬幣,紙幣,郵票,趣味品,茶品
聯絡人姓名(中文):張三
聯絡人姓名(英文):
電話:123232328899
傳真:QQ23232370566
網址:
電郵: [email protected]



------解決思路----------------------
foreach ($information as $row) {        
$row['content_tc']=preg_replace("/[ \t]+/", '',$row['content_tc']);
$row['content_tc']=nl2br($row['content_tc']);
$informationAfterHandle[] = $row;
}
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.