js加密参数encodeURIComponent,php解密参数urldecode

window.location.href='download_file?text=' + encodeURIComponent(text) + '&voice=' + voice + '&speech_rate=' + speech_rate;
if (!$text = trim($_REQUEST['text'])) {
    $this->json->E('请输入文本内容');
}
$text = urldecode($text);

避免特殊字符,影响参数传递。

原文地址:https://www.cnblogs.com/jiqing9006/p/13176822.html