can any tell how to remove characters after ? in php. I have one string test?=new i need to remove the characters as well as = from that string.
This solution uses a simple regular expression to remove the ? character and all characters following it.
?
$string = "test?p=new"; $new_string = preg_replace("/\?.+/", "", $string);