urlencode() encodes all non-alphanumeric characters except - (hyphen)_ (underscore) and replaces the spaces with + (plus) signs. This is the way a browser posts form data to the server.
rawurlencode() is basically the same but is RFC1738 compliant. The difference is that spaces are not transformed into + signs.
When passing vars as GET parameters through the URL you want to use urlencode().
When passing e.g. a password to a FTP server in the URL use rawurlencode();
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.