<?php /** * wechat php test */ //define your token //define("TOKEN", "hillock"); require_once 'config.php'; $wechatObj = new wechatCallbackapiTest(); $wechatObj->index(); //include 'SimpleImage.php'; class wechatCallbackapiTest { public function index() { if ($_SERVER['REQUEST_METHOD'] == "POST") { $this->responseMsg(); } else { if ($_SERVER['REQUEST_METHOD'] == "GET") { $this->valid(); } else { // OTHER } } } public function valid() { $echoStr = $_GET["echostr"]; //valid signature , option if ($this->checkSignature()) { echo $echoStr;