PDA

View Full Version : [php] "\n" with < ENTER >



MTsoul
September 2nd, 2004, 05:01 PM
Hey everyone,

I've been having some problems with "\n" and < ENTER >.

How can i replace this: "

" in a str with "\\n"? I tried str_replace ("\n", "\\n (file://\n)", $str);, but it doesn't seem to work.

What i'm trying to do is preg_match ("/yada.*moreyada/", "just some yada", $str); But the line brakes in $str don't seem to help. the "\" part of "\n" messes up the preg_match part. How can I avoid this?

Thanks =)