decryptmsg($sreqmsgsig, $sreqtimestamp, $sreqnonce, $sreqdata, $smsg);if ($errcode == 0) { $poststr=$smsg; //以下恢复为普通微信的操作 $postobj = simplexml_load_string($poststr, 'simplexmlelement', libxml_nocdata); $fromusername = $postobj->fromusername; $tousername = $postobj->tousername; $content = trim($postobj->content); $time = time(); $texttpl = %s; $srespdata= sprintf($texttpl, $fromusername, $tousername, $time, $content); //加密输出 $sencryptmsg = ; //xml格式的密文$errcode = $wxcpt->encryptmsg($srespdata, $sreqtimestamp, $sreqnonce, $sencryptmsg);if ($errcode == 0) { echo $sencryptmsg; } else { print(err: . $errcode . \n\n); // exit(-1); } } else { print(err: . $errcode . \n\n); //exit(-1);}?>
