[PHP] Re: Best way to encode?

2005-01-20 Thread Sephiroth
in HTML with HTTP_GET, you can use: xxx.href = my.php?data=+encodeURI(escape(...foreign strings...)); my.php: $data = uniDecode($_GET[data]); echo $data; function uniDecode($sText) { $sData = preg_replace_callback(/%u[0-9A-Za-z]{4}/,toUtf8, $sText); return unescape($sData); } function

[PHP] Re: Best way to encode?

2005-01-19 Thread Michiel van der Blonk
Hi, use base64_encode() and base64_decode actually, base32_encode or hexencode would be better, but oh my, php doesn't have these built in. If you're using PEAR there is a DataObject_Filter class somewhere that's handy for encoding decoding on the fly. Kind regards, Michiel