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, ∼3498🔥, 0💬
Popular Posts:
How To Read the Entire File into a Single String in PHP? If you have a file, and you want to read th...
How to use the "Ctrl-p Ctrl-q" sequence to detach console from the TTY terminal of container's runni...
Where to find tutorials on Using Azure API Management Publisher Dashboard? Here is a list of tutoria...
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...
How to add an API to an API product for internal testing on the Publisher Portal of an Azure API Man...