-1

Possible Duplicate:
Remove all the line breaks from the html source

I have a code bellow

$a = "<br />
      <br />Regards<br />
      admin";

the out put is same as above code and, i want the result following format

<br /><br />Regards<br />admin
Community
  • 1
  • 1

3 Answers3

0

this is about string replace

    $a = "<br />
          <br />Regards<br />
          admin";

    $a = str_replace(PHP_EOL,"",$a);

    var_dump($a);

// Regexp example

$a = preg_replace('/$/','',$a);
0

use

print_r($a);

i guess this should do the trick

dhpratik
  • 1,100
  • 4
  • 19
  • 43
  • 1
    [`print_r`](http://php.net/print_r) is a debugging tool, not a way to produce output intended for users. – Charles Dec 28 '12 at 09:10
0

If this is just about prettifying your code, can you just use this?

$a = "<br />".
     "<br />Regards<br />".
     "admin";

I've done that on many occasions. Otherwise, as mentioned by Tufan above, you'll have to do some parsing and replacing of your text.

King Skippus
  • 3,801
  • 1
  • 24
  • 24