[ create a new paste ] login | about

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

PHP, pasted on Apr 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

$data = <<< DATA
data
data
#comment
;comment
data ;comment
data #comment
DATA;

echo preg_replace(
	'/
	    [;#]    # find strings starting with ; or #
	    .*      # and everything following that
	    $       # until it ends in a newline
	/mx',       // make it span multilies
	'',
    $data
);


Output:
1
2
3
4
5
6
data
data


data 
data 


Create a new paste based on this one


Comments: