Tools, FAQ, Tutorials:
Remove Trailing New Line Character in PHP
How To Remove the New Line Character from the End of a Text Line?
✍: FYIcenter.com
If you are using fgets() to read a line from a text file, you may want to use the chop() function to remove the new line character from the end of the line as shown in this PHP script:
<?php $handle = fopen("/tmp/inputfile.txt", "r"); while ($line=fgets()) { $line = chop($line); # process $line here... } fclose($handle); ?>
⇒ Removing Leading and Trailing Spaces in PHP
⇐ Ways to Remove Leading and Trailing White Spaces in PHP
2016-10-13, ∼2627🔥, 0💬
Popular Posts:
How to use the JSON to XML Conversion Tool at freeformatter.com? If you want to try the JSON to XML ...
How to add request URL Template Parameters to my Azure API operation 2017 version to make it more us...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value mul...
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...