Enterprise Development PHP Version 2-text message
Returns the text message sent by the user and modifies the sample.php
Decryptmsg ($sReqMsgSig, $sReqTimeStamp, $sReqNonce, $sReqData, $SMSG), if ($errCode = = 0) {$postStr = $SMSG;//The following reverts to normal Operation $postobj = simplexml_load_string ($postStr, ' simplexmlelement ', libxml_nocdata); $fromUsername = $postObj->fromusername; $toUsername = $postObj->tousername; $content = Trim ($postObj->content ); $time = time (); $TEXTTPL = "
%s
%s
%s
text
%s
"; $sRespData = sprintf ($TEXTTPL, $fromUsername, $toUsername, $time, $content);//encryption Output $sencryptmsg = ""; Ciphertext in XML format $errcode = $wxcpt->encryptmsg ($sRespData, $sReqTimeStamp, $sReqNonce, $SENCRYPTMSG); if ($errCode = = 0) { Echo $SENCRYPTMSG; } else {print ("ERR:". $errCode. "\ n");//exit (-1);} } else {print ("ERR:". $errCode. "\ n");//exit (-1);}? >