<?php
/**
*  我想把字符串中含有  http://blog.3snews.net/?uid-41069-action-viewspace-itemid-27559 替换成
*  http://blog.3snews.net/index.php?uid=41069&itemid=27559 (保留原来的参数替换链接)
*
**/
$str1 = "左字符串http://blog.3snews.net/?uid-41069-action-viewspace-itemid-27559右字符串";
$str2 = "左字符串http://blog.3snews.net/?uid-5551-action-viewspace-itemid-12345右字符串";?>
字符串规则:http://blog.3snews.net/?uid-任意UID-action-viewspace-itemid-任意ITEMID
替换规则  :http://blog.3snews.net/index.php?uid=对应上面的UID&itemid=对应上面的ITEMID
把$str1、$str2这一类字符串中的链接按规则替换