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, ∼2891🔥, 0💬
Popular Posts:
How to Install Docker Desktop 2.5.0 on Windows 10? You can follow this tutorial to Install Docker De...
How to use the "send-one-way-request" Policy statement to call an extra web service for an Azure API...
How to troubleshoot the Orderer peer? The Docker container terminated by itself. You can follow this...
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
Where to find tutorials on Microsoft Azure services? Here is a large collection of tutorials to answ...