Re: PHP 4.0 Bug #9173 Updated: getline
| From: | Angelo Mandato | Date: | Thu, 08 Feb 2001 15:15:47 +0000 |
| Subject: | Re: PHP 4.0 Bug #9173 Updated: getline | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-46030@lists.php.net to get a copy of this message | ||
getline in C++ does not limit the delim character with just a newline. if I wanted, I could do a getline on a string stream where the line ends with "|". example:
strstream sin;
sin.getline( szBuffer, nLength, '|' );
I would think this would be highly useful. It is just a suggested feature to add.
Also, with getline, it does not return the delim "|" character in the szBuffer.
At 03:02 PM 2/8/01 +0000, you wrote:
ID: 9173
Updated by: cynic
Reported By: amandato@unitedmcgill.com
Old-Status: Open
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:
please, read the manual: fgets does what you want.
Previous Comments:
---------------------------------------------------------------------------
[2001-02-08 09:47:41] amandato@unitedmcgill.com
Add a getline feature to the file and string routines. is it possible to incorporate the iostream style stdin/stdout in php?
this is the getline i wrote:
function getline( $fp, $delim )
{
$result = "";
while( !feof( $fp ) )
{
$tmp = fgetc( $fp );
if( $tmp == $delim )
return $result;
$result .= $tmp;
}
return $result;
}
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9173&edit=2
<><><><><><><><><><><><><><><><><><><><><><><><><><><>
Name: Angelo Mandato
Phone: (614) 443-0192 ext. 2551
Title: Programmer
E-mail: amandato@unitedmcgill.com
<><><><><><><><><><><><><><><><><><><><><><><><><><><>
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************