首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

呀,关于html标签内的换行解决···

2012-03-24 
求助呀,关于html标签内的换行解决PHP code?php$html /tbody/tableinput typehidden nameprt

求助呀,关于html标签内的换行解决···

PHP code
<?php$html = '</tbody></table><input type="hidden" name="prt" value="1" /> <input type="image" src="/images/add_t_s_c.png" /></form>';$content=preg_replace("xxx","",$html);echo $content;?> 


像上面的例子,<input>标签里出现了换行,如何通过正则表达式去把换行给去掉呢?
我写了很久,都没办法去掉换行。求高人帮忙~~~~~

[解决办法]
PHP code
$html = '</tbody></table><input type="hidden" name="prt" value="1" /> <input type="image" src="/images/add_t_s_c.png" /></form>';$content=preg_replace("/([^>])[\r\n]+/x","$1",$html);echo $content; 

热点排行