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, ∼3412🔥, 0💬
Popular Posts:
How To Protect Special Characters in Query String in PHP? If you want to include special characters ...
How to Instantiate Chaincode on BYFN Channel? You can follow this tutorial to Instantiate Chaincode ...
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...
How to convert JSON Objects to PHP Associative Arrays using the json_decode() function? Actually, JS...