Page 1 of 1

how to decode strings using php

Posted: Wed Feb 13, 2008 2:10 am
by seco
Hi
i use this js function to decode my strings like (%u0645%u062D%u0645%u062F) and works very well and returns correct results with me
unescape(encoded.replace(/\+/g, " "));

i want php function that can do the same.
i try urldecode and rawurldecode but they do nothing !! just return the strings as it is .

thanks in advance.

Re: how to decode strings using php

Posted: Wed Feb 13, 2008 9:55 am
by Jonah Bron
You can't. The only way to verify data, is to check if the data in encrypted form matches the already-encrypted data.
PHP: crypt - Manual wrote:Notes
Note: There is no decrypt function, since crypt() uses a one-way algorithm.
http://us2.php.net/manual/en/function.crypt.php

Re: how to decode strings using php

Posted: Wed Feb 13, 2008 10:07 am
by liljester
i think hes talking about url encoding/decoding, not encryption

Re: how to decode strings using php

Posted: Wed Feb 13, 2008 10:39 am
by liljester
have you tried the user contributed suggestions on the urldecode documentation site?