我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

将这两个正则表达式合并为一个[关闭]

I feel like I can learn a lot by seeing these two regular expressions as one. Mainly selecting the space in between > and < while not selecting the > and < themselves, so I can replace it with "" rather than "><". Is there a way that these could be merged without selecting that space?

    $html = preg_replace('/(
)|()/',"",$html);
    $html = preg_replace('/>(\s+)</',"><",$html);
$html = preg_replace('/[
]+|(?<=>)\s+(?=<)/',"",$html);

近期文章

  • 如何在dql(symfony2)中使用sql数学函数
  • Oauth :: timestamp在linkedin api中拒绝错误
  • Ubuntu上的LAMP创建写保护文件
  • 如何从PHP中的嵌套数组中提取数据?
  • 我的PHP内存为何以及如何耗尽? [重复]
  • UTF8非ASC事件列表无效[关闭]
  • 如何将单引号嵌套到单引号中?
  • PHP上传多个文件只上传1个文件
  • AJAX成功后页面不刷新
  • JQuery:.change中的多个条件(function()
  • 使用jQuery onClick按钮淡入PHP脚本
  • Android上“无法连接到数据库”错误
  • 动态更改表中的行字体颜色
  • 使用jquery修改服务器端功能
  • Google联系人API更新联系人 - 未找到
  • 基于sql查询从数组中删除元素
  • WooCommerce防止格式化数字链接
  • 当值存在时,PHP获取XML节点属性
  • 如何在PHP中进行特殊字符验证
  • 基于php中的特定值合并数组

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华