[ create a new paste ] login | about

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

PHP, pasted on Nov 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

$string = '/* CSS Content */

.class{
    text-align:center;
    border-bottom:1px solid #ccc;
}

.anotherclass, .another, .another{
    text-align:center;
    border-bottom:1px solid #ccc;
}';
echo preg_replace("#(?<=[{};])\s+|\/\*.+?\*\/#","",$string);


Output:
1
2
3


.class{text-align:center;border-bottom:1px solid #ccc;}.anotherclass, .another, .another{text-align:center;border-bottom:1px solid #ccc;}


Create a new paste based on this one


Comments: