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, ∼3702🔥, 0💬
Popular Posts:
Where to get a JSON.stringify() Example Code in JavaScript? Here is a good JSON.stringify() example ...
How to enter < sign in '@(...)' expressions? < signs can be entered in '@(...)' expres...
How to use the "send-one-way-request" Policy statement to call an extra web service for an Azure API...
What is test testing area for? The testing area is provided to allow visitors to post testing commen...
How to use the "@{...}" expression block in Azure API Policy? The "@{...}" expression block in Azure...