Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Remove the New Line Character from the End of a Text Line
How To Remove the New Line Character from the End of a Text Line? - PHP Script Tips - PHP Built-in Functions for Strings
✍: 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); ?>
2007-04-22, 4814👍, 0💬
Popular Posts:
How to convert a Unix timestamp to a Win32 FILETIME or SYSTEMTIME? The following function converts a...
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf(...
How To Get the Uploaded File Information in the Receiving PHP Script? Once the Web server received t...
Write out a function that prints out all the permutations of a string. For example, abc would give y...
What Happens If the UPDATE Subquery Returns Multiple Rows? - Oracle DBA FAQ - Understanding SQL DML ...