对待每一个“进入”者.当数据从数据库中输出时,作为换行符


Treat every "enter" as line break when that data comes out of a database

基本上我有这样的信息存储在数据库中:

13:41:24 - Lord_Nico_of_Vanguard has joined the game with ID: 108857
13:41:32 - Lord_Nico_of_Vanguard joined the Variance Trade & Mercenaries Company.
13:42:55 - *FACTION* Variance Trade & Mercenaries Company [Lord_Nico_of_Vanguard] bonjour mona mie
13:43:04 - *FACTION* Variance Trade & Mercenaries Company [Lord_Nico_of_Vanguard] much french
13:43:45 - *LOCAL* [Lord_Nico_of_Vanguard] sure
13:43:47 - Lord_Nico_of_Vanguard has equipped Morningstar
13:43:47 - Lord_Nico_of_Vanguard has picked up Morningstar
13:43:49 - *LOCAL* [Lord_Nico_of_Vanguard] thank you

这也是我想用echo显示它的方式,但是当我尝试这样做时,我得到了这样的输出:

13:41:24 - Lord_Nico_of_Vanguard has joined the game with ID: 108857 13:41:32 - Lord_Nico_of_Vanguard joined the Variance Trade & Mercenaries Company. 13:42:55 - *FACTION* Variance Trade & Mercenaries Company [Lord_Nico_of_Vanguard] bonjour mona mie 13:43:04 - *FACTION* Variance Trade & Mercenaries Company [Lord_Nico_of_Vanguard] much french 13:43:45 - *LOCAL* [Lord_Nico_of_Vanguard] sure 13:43:47 - Lord_Nico_of_Vanguard has equipped Morningstar 13:43:47 - Lord_Nico_of_Vanguard has picked up Morningstar 13:43:49 - *LOCAL* [Lord_Nico_of_Vanguard] thank you

我像这样重复我的台词:echo '<b>What happened:&nbsp;&nbsp;</b><div id="what_happened" style="max-height:600px; overflow:auto;">' . $player_complaints_offence . '</div></b><p></fieldset><p>';

是否有办法用
或PHP preg替换的东西来替换输入空格?我试着去找,但是什么也找不到。

感谢您的阅读。

你可以使用前置标签:

echo '<b>What happened:&nbsp;&nbsp;</b>
        <div id="what_happened" style="max-height:600px; overflow:auto;">
            <pre>' . $player_complaints_offence . '</pre>
       </div>
    </b><p> </fieldset><p>';