<?php
$string = "list page.php?cpage=1, list page.php?cpage=2, list page.php?cpage=3 thats all";
//$string = str_replace("?cpage=", "/", $string);
preg_match_all("/?cpage=/", $string, $matches);
foreach($matches[0] as $value) {
echo $value . '<br />';
}
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
Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in /in/KYrU4 on line 6
Warning: Trying to access array offset on null in /in/KYrU4 on line 8
Warning: foreach() argument must be of type array|object, null given in /in/KYrU4 on line 8
list page.php?cpage=1, list page.php?cpage=2, list page.php?cpage=3 thats all
Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in /in/KYrU4 on line 6
Warning: Trying to access array offset on value of type null in /in/KYrU4 on line 8
Warning: foreach() argument must be of type array|object, null given in /in/KYrU4 on line 8
list page.php?cpage=1, list page.php?cpage=2, list page.php?cpage=3 thats all
Output for 7.4.0 - 7.4.33
Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in /in/KYrU4 on line 6
Notice: Trying to access array offset on value of type null in /in/KYrU4 on line 8
Warning: Invalid argument supplied for foreach() in /in/KYrU4 on line 8
list page.php?cpage=1, list page.php?cpage=2, list page.php?cpage=3 thats all
Output for 7.3.0 - 7.3.33
Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in /in/KYrU4 on line 6
Warning: Invalid argument supplied for foreach() in /in/KYrU4 on line 8
list page.php?cpage=1, list page.php?cpage=2, list page.php?cpage=3 thats all
Warning: preg_match_all(): Compilation failed: nothing to repeat at offset 0 in /in/KYrU4 on line 6
Warning: Invalid argument supplied for foreach() in /in/KYrU4 on line 8
list page.php?cpage=1, list page.php?cpage=2, list page.php?cpage=3 thats all