本文整理汇总了PHP中wechatCallbackapiTest::forwardToWeibo方法的典型用法代码示例。如果您正苦于以下问题:PHP wechatCallbackapiTest::forwardToWeibo方法的具体用法?PHP wechatCallbackapiTest::forwardToWeibo怎么用?PHP wechatCallbackapiTest::forwardToWeibo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wechatCallbackapiTest
的用法示例。
在下文中一共展示了wechatCallbackapiTest::forwardToWeibo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: valid
<?php
require 'config.php';
$wechatObj = new wechatCallbackapiTest();
$wechatObj->valid();
require 'ImagePoster.php';
$wechatObj->forwardToWeibo();
class wechatCallbackapiTest
{
var $poster;
public function valid()
{
$echoStr = $_GET["echostr"];
//valid signature , option
if ($this->checkSignature()) {
echo $echoStr;
}
}
public function forwardToWeibo()
{
$this->poster = new ImagePoster();
//get post data, May be due to the different environments
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
//extract post data
if (!empty($postStr)) {
$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$msgType = $postObj->MsgType;
$fromUsername = $postObj->FromUserName;
$key = $fromUsername . 'key';
$toUsername = $postObj->ToUserName;
if ($msgType == 'image') {