|
Posted by julian_m on 06/07/06 07:49
lorento wrote:
> Try this :
>
> <?php
> $str = "Hello World ///World Hello\n";
> $str .= "Hellloooooo ///allohhhaaaa\n";
>
> echo "<b>Before : </b><br>$str<br><br>";
>
> echo "<b>After:</b><br>";
> echo preg_replace ("/\/\/\/(.*)/", "", $str);
>
> ?>
Great. Just a small detail which I cant't achieve even though both you
and Rik gave me excelent advice:
Your code output is:
After:
Hello World Hellloooooo
whereas I would like to get
Hello World
Hellloooooo
So I thought it would be esay to solve just changing
>>>echo preg_replace ("/\/\/\/(.*)/", "", $str);
to
>>>echo preg_replace ("/\/\/\/(.*)/", "/n", $str);
Note the "/n"
But it actually doesn't work at all.
What's wrong? Why "/n" doesn't do anything?
regards - julian
Navigation:
[Reply to this message]
|