![]() If you are encoding query component, use urlencode().When to use urlencode() and rawurlencode() Encoding URLsĮvery HTTP URL conforms to the following generic URI If you are encoding path segment, use rawurlencode(). Also since PHP 5.3.0, urlencode() and rawurlencode() also differ in that rawurlencode() does not encode tilde ( ~), while urlencode() does. So the difference is that urlencode() encodes space as + and rawurlencode() encodes space as %20. This is the encoding described in RFC 3986 for protecting literal characters from being interpreted as special URL delimiters, and for protecting URLs from being mangled by transmission media with character conversions (like some email systems). Returns a string in which all non-alphanumeric characters except -_.~ have been replaced with a percent ( %) sign followed by two hex digits. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application/x-rawurlencode(): have been replaced with a percent ( %) sign followed by two hex digits and spaces encoded as plus ( +) signs. Returns a string in which all non-alphanumeric characters except -_. The difference between these two PHP functions is in their return values. Difference between urlencode() and rawurlencode()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |