Urlencode can be used to encode a string that can be used in a url. It encodes the same way posted data from web page is encoded. It returns the encoded string.
urlencode (string $str )
Urldecode can be used to decode a string. Decodes any %## encoding in the given string (Inserted by urlencode)
urldecode (string $str )