Re: mail() silly question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Question:

Why? What's the real difference between
   $header .= 'From: info@xxxxxxxxxxxxxxxxxxxx' . "\r\n";
and
   $header .= 'From: info@xxxxxxxxxxxxxxxxxxxx\r\n";

Your second declaration is incorrect: you start with a single quote ('), and you end with a double (").

So, you'd say "ok, let's fix it":
$header .= 'From: info@xxxxxxxxxxxxxxxxxxxx\r\n';

BUT, special chars like \n or \r need to be inside a double-quoted string in order to be taken into account.

This one is then correct:
$header .= 'From: info@xxxxxxxxxxxxxxxxxxxx' . "\r\n";

This one as well:
$header .= "From: info@xxxxxxxxxxxxxxxxxxxx\r\n";


Ludovic André

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux