/e/tags/index.php?page=23&tagname=%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4&line =3&tempid=13
preg_replace() を使用してこれを
/tag-%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8% F1 に置き換えます%D1%D4/23/
page=0 の場合、
/tag-%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4 % に置き換えます。 B8%F1%D1%D4/
$str="/e/tags/index.php?page=0&tagname=%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4&line=3&tempid=13";$s= preg_replace_callback( '#.+?page=(\d+)&tagname=([^&]+)&.+#', create_function( '$matches', 'return "/tag-$matches[2]/". ($matches[1] ? $matches[1]."/" : "");' ), $str);echo $s;
れーれー
/tag-%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8% F1 %D1%D4/
毎回問題の解決に協力していただき、ありがとうございます
http://bbs.csdn.net/topics/390575116
$str="/e/tags/index.php?page=0&tagname=%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4&line=3&tempid=13";$s= preg_replace_callback( '#.+?page=(\d+)&tagname=([^&]+)&.+#', create_function( '$matches', 'return "/tag-$matches[2]/". ($matches[1] ? $matches[1]."/" : "");' ), $str);echo $s;
/tag- %B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4/
教えてください
$str="/e/tags/index.php?page=0&tagname=%B9%D8%D3%DA%D3%D1%D2%EA%D5%E4%B9%F3%B5%C4%B8%F1%D1%D4&line=3&tempid=13";$s= preg_replace_callback( '#.+?page=(\d+)&tagname=([^&]+)&.+#', create_function( '$matches', 'return "/tag-$matches[2]/". ($matches[1] ? $matches[1]."/" : "");' ), $str);echo $s;