thuk thuk - 1 year ago 141
PHP Question

Decode base64 string - php

Is there any way to decode this string??

Actual string : 其他語言測試 - testing

base64 encode while sending on mail as subject as


echo base64_decode('GyRCQjZCPjhsOEBCLDtuGyhCIC0gdGVzdGluZw==');

This is base 64 encode, I couldn't decode it to actual Chinese string.Since it has been encoded using "iso-2022-jp", I have also tried online site to decode this string, but I couldn't find the original string, how can I do that?

Answer Source

Use iconv():

$input = base64_decode('GyRCQjZCPjhsOEBCLDtuGyhCIC0gdGVzdGluZw==');//$BB6B>8l8@B,;n(B - testing
$input_encoding = 'iso-2022-jp';
echo iconv($input_encoding, 'UTF-8', $input); //其他語言測試 - testing
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download