I am passing variables from a form to make a link, but one of the fields may contain spaces. Is there anyway to convert the spaces in the string when making the link into the "%20" bit?
urlencode() encodes the string ready for use in a URI/URL.
htmlentities() encodes the string ready for use as literal output to the user-agent, replacing < and > with < and > respectively, amongst other char's. This would also need to be urlencode()'ed because the ampersand and semi-colon are not valid URL characters.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.