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, 2215🔥, 0💬
Popular Posts:
How to run PowerShell Commands in Dockerfile to change Windows Docker images? When building a new Wi...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
How to use the "find-and-replace" Policy Statement for an Azure API service operation? The "find-and...
What is Azure API Management Publisher Dashboard? Azure API Management Publisher Dashboard is an Azu...
Where to see some Examples of Invalid JSON Values? Here are some Examples of Invalid JSON Values: 1....