I've been looking for the functions [used to encode and decode URL] that can be exchangable between PHP and Javascript [I can encode the URL in javascript and decode it in PHP and vice versa], there are many solutions come up, like escape() and unescape(); encodeURI() and decodeURI() for javascript, or urlencode() and urldecode() for PHP, but there is no pair which can works together perfectly. Because I want to send post data using Ajax jQuery for a PHP page to use, and data can be mixed with special character, that's why I need a function that works the same in PHP and Javascript:
Example:
$.ajax{url: "test.php", data: "http://www.thisURLContainSpecialCharac.ter"}
See the code above? It contains special characters in data, that may cause problem.
I appreciate any advice :). Thanks. [x]