PHP preg_replace使用例子

将 qwer://xxx/545/0 替换为 qwer://trading_system_xxx/0/545

$str = '<a href="qwer://xxx/545/0">xxx</a>';
$str = preg_replace('/qwer://xxx/(d+)/(d+)/i' ,'qwer://trading_system_xxx/$2/$1/',$str);

  

原文地址:https://www.cnblogs.com/lzs-888/p/5978286.html