本帖最后由 xxc_00126 于 2013-9-13 16:59 编辑
今天用了新版的微信插件,现在提供兼容代码,能看懂并举一反三的请看,其他的路过- <?php
- $postStr = file_get_contents("php://input");
- $_GET['id']='dz55625_haodian_weixin:weixin';
- if (!empty($postStr)){
- $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
- $message=$postObj->Content;
- if(!empty($message)){
- $message=trim($message);
- $verify='/[\d]{1}/';
- if(preg_match($verify, $message)){
- $_GET['id']='dz55625_haodian_weixin:weixin';
- }
- if (strstr($message,"标题@")){
- $_GET['id']='dz55625_haodian_weixin:weixin';
- }
- if (strstr($message,"内容@")){
- $_GET['id']='dz55625_haodian_weixin:weixin';
- }
- if (strstr($message,"#")){
- $_GET['id']='singcere_wxpublic';
- }
- }
- }else{
- echo "";
- exit;
- }
- require './plugin.php';
- exit();
- ?>
复制代码 |