Re: Imap, reading the email-body

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

 



hi,

I think that I understood you problem some what,
if you are having newline character (\n) in you string ,
then you can use Regular expression to replace the \n character
with <br /> tag.

why can't you try something like the following

---------code------------
<?php
/* this is the convert newline character(s) into <br/> tag */
$string = "this is to first_line\nthis is second line.\nthird line";

$search = '@[\n]+@';
$replace = '<br />';

$result = preg_replace($search, $replace, $string);
print $result;
?>
------------------------------
if your input is like the value of "$string" then this will help you.

On 10/19/05, Bruno Gola <brunogola@xxxxxxxxxxxx> wrote:
>
> Hi guys,
>
> I need some help with the imap_body function and how to work with the
> string that this function returns...
>
> Im working on a mailing list archive website and i'm using the imap_*
> functions to handle this, the header works fine (and other things too)
> but the Body of the message dont work as expected. It came as one-line
> string, the "\n" character (or <br> in html) is simple ignored. I dont
> know how to make the function translate the "\n" to <br>.
>
>
> You can understand better what i'm saying looking:
>
> http://www.brunogola.com.br/testeimap.php
>
> Look the main page and try to read any message... I dont know what can i
> do to fix it...
>
> Thanks for any help and sorry any mistakes about my english...
>
> Bruno Gola
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
with regds,
Nahalingam.

[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