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, ∼2860🔥, 0💬
Popular Posts:
What is Azure API Management Developer Portal? Azure API Management Developer Portal is an Azure Web...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
How To Remove Slashes on Submitted Input Values in PHP? By default, when input values are submitted ...
How To Change Text Fonts for Some Parts of a Paragraph? If you want to change text fonts or colors f...
Tools, FAQ, Tutorials: JSON Validator JSON-XML Converter XML-JSON Converter JSON FAQ/Tutorials Pytho...