> -----Original Message-----
> From: Brian McGarvie [mailto:[EMAIL PROTECTED]
> Sent: 12 June 2003 11:42
> 
> Kinda... I get it to return one line...
> 
> The code:
> 
> <?php
> define('STDIN',fopen("php://stdin","r"));
> $str = fgets(STDIN);
> mail("[EMAIL PROTECTED]","Test","Test 
> Test...\n\nOriginal
> Email:\n\n$str");
> ?>
> 
> Emails me:
> 
> Test Test...
> 
> Original Email:
> 
> >From [EMAIL PROTECTED] Thu Jun 12 11:41:39 2003

That seems right.  The description in the manual at http://uk.php.net/fgets
says:

  "Reading ends when length - 1 bytes have been read, on a
  newline (which is included in the return value), or on EOF
  (whichever comes first)."

As your fgets() call is not in a loop, you only get to the first newline as
that is what comes first.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to