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.
You can do this with a well-written regex, but the much simpler and quicker way to do it is to explode the string on the "?" character, and use the first element in the resulting array.
$str = "test?=new";
$str2 = explode("?", $str);
$use_this = $str2[0];
$use_this[0] will be "test". If you want to add the "?" back, just concatenate:
$use_this = $use_this."?";