3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "list page.php?cpage=1, list page.php?cpage=2, list page.php?cpage=3 thats all"; preg_match_all("/cpage=[0-9]/", $string, $matches); foreach($matches[0] as $value) { echo $value . '/'; $string = str_replace("?cpage=", "/", $matches); } //echo $string; //hasil list page.php1, list page.php2, list page.php3 thats all //yg diinginkan list page.php/1/, list page.php/2/, list page.php/3/ thats all

preferences:
43.78 ms | 402 KiB | 5 Q