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, 1991🔥, 0💬
Popular Posts:
Where to get the detailed description of the json_encode() Function in PHP? Here is the detailed des...
Where can I download the EPUB 2.0 sample book "The Metamorphosis" by Franz Kafka? You can following ...
What is the "__init__()" class method? The "__init__()" class method is a special method that will b...
How to search for the first match of a regular expression using re.search()? The re.search() functio...
How to convert a JSON text string to an XML document with PHP language? Currently, there is no built...