You can use this code to remove query string from URL.
<?php
$url = "http://www.testDomain.com/testPage.php?q1=queryString1&q2=queryString2";
$search = '|(\.php)(.*)|i';
$replace = '${1}';
echo preg_replace( $search, $replace, $url );
?>
Comments
Post a Comment