2015-03-30 104 views
1

我试图清理一个CSS脚本,它由一个单一的线,像这样:PHP插入换行符发现

footer .column .f-links li a{color:#1297de;font-size:14px}footer .column .address{font-size:14px;color:#3d3d3d}footer .column .infos{margin-top:10px;color:#3d3d3d}footer .column .infos .phone{background:url("../images/icon-phone.png") no-repeat 0 2px;padding:0 0 0 25px;margin-bottom:10px}@media (min-width:1023px) and (max-width:1024px){footer .column .infos .phone{font-size:10px;line-height:24px;padding-top:7px}footer .column .infos .email{font-size:10px;padding-top:7px}} 

,我想插入一个换行符前分别在字符“{”和“}”之后。

我感谢您的意见。

+1

'$海峡= str_replace函数(阵列( '{', '}'),阵列( “\ N {\ n”, “\ N} \ n” 个), $ str);' – 2015-03-30 20:02:48

+0

还有* Unminify *东西的工具/ Web应用程序,这实质上就是一行'.css'文件(通常来说)。 – 2015-03-30 20:03:46

+0

他没有要求缩进! ;) – 2015-03-30 20:05:48

回答