' Wxtest1 ', ' appid ' = ' wx5b79a26868798826 ', ' appsecret ' = ' a95952819cc768fc130bc0cc0444ae77 ', ' myweixinid ' = > ' gh_746ed5c6a58b '); $zhwx->setconfig ($CONFIGARR);//configuration file if ($zhwx->validtoken ()) {if ($zhwx Weixinbaseapimessage ()) {$keyword = $zhwx->getusertextrequest ();//Get user-sent content $msgtype= $zhwx->getusermsgtype () ///Get the data type $sendtime= $zhwx->getusersendtime ();//Get the user to send the time if ($msgtype = = ' text ' && $keyword = = ' News ') {$ Newsdata=array (the title of the first News, ' Description ' = ' The first piece of news ', ' picurl ' = ' http://t12.baidu.com/it /u=1040955509,77044968&fm=76 ', ' Url ' = ' http://wxphptest1.applinzi.com/news.php?id=1 '), Array (' Title ' = = ' The title of the second piece of News ', ' Description ' and ' the first news of the introduction ', ' picurl ' = ' http://images.cnitblog.com/blog2015/340216/201505/' 051316468603876.png ', ' Url ' = ' http://wxphptest1.applinzi.com//news.php?id=2 '), $zhwx->responsemessage (' News ', $newsData);}}
The above describes the API text message case, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.