Re: Imap, reading the email-body
| From: | Nahalingam N. Kanakavel | Date: | Wed, 19 Oct 2005 16:47:04 +0000 |
| Subject: | Re: Imap, reading the email-body | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224336@lists.php.net to get a copy of this message | ||
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@terra.com.br> 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.