My question is related to this one. except that my question is more sepcific as it is about whether a hyphen can be used in a query string parameter value.
I am parsing $_SERVER['QUERY_STRING']
with PHP. I would like to know whether it is syntactically correct to use hyphens in query string values such as in the following case, or whether hyphens must be escaped in the browser URL. What about underscores?
http://example.com/?q1=query-string-value-one&q2=query-string-value-two
According to this document hyphens should be OK in all standards-compliant browsers, but I wanted to double check.
Thanks.
hyphens
can be used . only characters can reliably use for the actual name parts of a URL are a-z, A-Z, 0-9, -, ., _, and ~.