【发布时间】:2015-10-23 13:52:59
【问题描述】:
得到这个代码
<?php
$string = "list page.php?cpage=1, list page.php?cpage=2, list page.php?page=3 thats all";
$string = preg_replace("/\?cpage=[0-9]/", "/", $string);
echo $string;
//result
//list page.php/, list page.php/, list page.php/ thats all
//what i want
//list page.php/1/, list page.php/2/, list page.php/3/ thats all
?>
有人可以帮忙吗?
【问题讨论】:
-
您有问题吗?
标签: php preg-replace