##<?php
define('TOKEN','peter');
$signature =$_GET['signature']; //Encrypted signature
$timestamp=$_GET['timestamp'];//Timestamp
$nonce=$_GET['nonce'] ;//Random number
$echostr=$_GET['echostr'];//Random string
//Sort the array
$arr=[$timestamp ,$nonce,TOKEN];
sort($arr,SORT_STRING);
$str=sha1(implode($arr));
//This request is From WeChat
if($signature==$str){
echo $echostr;
}
?>
Not all the code is written