How can I get only the content from a query string staring from ?:
asegment?param1=value1¶m2=value2
NOTE: I only need all the content after the "?", also I want to ommit that character.
How can I get only the content from a query string staring from ?:
asegment?param1=value1¶m2=value2
NOTE: I only need all the content after the "?", also I want to ommit that character.
Here is the Regex \?(.+)
, and a Rubular to prove it. And to use it:
preg_match("/\?(.+)/", $inputString, $matches);
if (!$matches) {
// no matches
}
$result = $matches[1];