PHP – Url Encode and Decode

Special characters in URL are encoded according to RFC 3986. You could get the encoded URL by rawurlencode().