Re: str_replace help
| From: | Ashley Sheridan | Date: | Fri, 02 Apr 2010 13:33:13 +0000 |
| Subject: | Re: str_replace help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303750@lists.php.net to get a copy of this message | ||
On Fri, 2010-04-02 at 09:28 -0400, David Stoltz wrote:
> Hi folks,
>
> In ASP, I would commonly replace string line feeds for HTML output like
> this:
>
> Var = replace(value,vbcrlf,"<br>")
>
> In PHP, the following doesn't seem to work:
> $var = str_replace(chr(13),"\n",$value)
>
> Neither does:
> $var = str_replace(chr(10),"\n",$value)
>
> What am I doing wrong?
>
> Thanks!
I see no reason why it shouldn't work other than maybe the string
doesn't contain what you think it does.
Thanks,
Ash
http://www.ashleysheridan.co.uk