How urlencode and urldecode can be used?

Urlencode can be used to encode a string that can be used in a url. It encodes the same way as posted data from web page is encoded. It returns the encoded string.
Syntax:

urlencode (string $str )

urlencode () is the function that can be used conveniently to encode a string before using in a query part of a URL. This is a convenient way for passing variables to the next page.
Syntax:

urldecode (string $str )

urldecode() is the function that is used to decode the encoded string. Urldecode can be used to decode a string. Decodes any %## encoding in the given string (Inserted by urlencode.)

Related posts