Trimming is not a best option to go with.
It will trim all the spaces which are even needed.
I had the same problem and what I did was made all the code in a single line.
テキストに含まれるスペースによって異なります。私のコードは以前はこのようなものでした
<div class="controls">
<textarea name="about" class="span12" id="terms" rows="5">
<?php include('includes/terms.php');?>
</textarea>
</div>
今、私が得ていた出力は次のようなものでした:
Terms and Conditions
Point one
Point two
Point 3
Last Paragraph
// Here was huge space right at the bottom of textbox
それで、私のコードを次のように変更しました:
<div class="controls"><textarea name="about" class="span12" id="terms" rows="5"><?php include('includes/terms.php');?></textarea></div>
これですべてが 1 行になり、以前にあったスペースと新しい行エントリはなくなりました。私のテキストは次のように印刷されました:
Terms and Conditions
Point one
Point two
Point 3
Last Paragraph
// Huge space is gone
開始点と終了点を除いて、textarea 要素に含まれるテキストにあるスペースも確認する必要があります。