WeChatバックエンド運用の基本管理

WBOY
リリース: 2016-06-13 12:17:46
オリジナル
868 人が閲覧しました

WeChat バックグラウンド操作 基本クラス管理

/**
* 作成者: PhpStorm.
* ユーザー: wym
* 日付: 15-3-18
* 時刻: 午後 2 時 15 分
*/

class Wx_function{
var $FromUsername = null;
var $ToUsername = null;
var $MsgType = null;
var $Event = null;
var $PicUrl = null;
var $EventKey = null;
var $Keyword = null;
var $obj = null ;

function __construct(){
//構築割り当て
$postObj = simplexml_load_string($GLOBALS["HTTP_RAW_POST_DATA"], 'SimpleXMLElement', LIBXML_NOCDATA);
$this-> ; obj = $postObj;
$this->FromUsername = $postObj->FromUserName;
$this->ToUsername = $postObj->ToUserName;
$this->EventKey = $ postObj->EventKey; //
$this->MsgType = $postObj->MsgType;
$this->PicUrl = $postObj->PicUrl;
$this-> ;イベント = $postObj->Event;
$this->キーワード = トリム($postObj->Content);
}


public function wxRequest( $arr, $response){
//異なる型は
$mssage = '';
switch ($response) {
case 'text' :
$mssage = $this -> wxGetText($arr);
ブレーク;
ケース 'ニュース' :
$mssage = $this->wxGetNews($arr);
ケース '音声':
$mssage = $this->getVoice($arr);
}
//print_r($arr); public function wxEventRequest($Content, $response = 'text'); 🎜> $mssage = '';
switch ($this->MsgType) {
case 'event':
switch ($this->Event) {

case 'subscribe' :

switch ($response) {
case 'text' :
$mssage = $this->gt;wxGetText ($Content);
break;
}
Break;
case '購読解除' :
Break;
}
Break;
return $mssage;
}

}



詳細なソースコードが必要な場合は、私に連絡してください


関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!