public function index(){
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
$postObj = simplexml_load_string($postStr, \'SimpleXMLElement\', LIBXML_NOCDATA);
$toUsername = $postObj->ToUserName;//公众号的微信号
$fromUsername = $postObj->FromUserName;//用户的微信号
$MsgType = $postObj->MsgType;//消息类型
$Event = $postObj->Event;//事件类型 首次关注=subscribe 已关注 SCAN
$EventKey = $postObj->EventKey;//事件key值
file_put_contents(\'weixinv.txt\', \'公众号微信号=\'.$toUsername.\' 用户公众号=\'.$fromUsername.\' 消息类型=\'.$MsgType.\' 事件类型=\'.$Event.\' 事件key值=\'.$EventKey,FILE_APPEND);
exit(htmlspecialchars($_GET[\'echostr\']));
}