[ create a new paste ] login | about

Link: http://codepad.org/xR3ie8me    [ raw code | output | fork ]

PHP, pasted on May 30:
<?php

  $test = <<<EOD


This is some text
This is more text

That was an empty line


There were a couple more

    This is a line with whitespace at the beginning


Here are some empties at the end


EOD;

  echo "'".preg_replace('/^[\r\n]+|[\r\n]+$/m', '', $test)."'";


Output:
1
2
3
4
5
6
'This is some text
This is more text
That was an empty line
There were a couple more
    This is a line with whitespace at the beginning
Here are some empties at the end'


Create a new paste based on this one


Comments: