本文整理汇总了PHP中Wechat::sendMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Wechat::sendMessage方法的具体用法?PHP Wechat::sendMessage怎么用?PHP Wechat::sendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wechat
的用法示例。
在下文中一共展示了Wechat::sendMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _log
<?php
include './qy-sdk/qywechat.class.php';
function _log($text)
{
file_put_contents('/opt/gdsserver/logs/wechat_log.txt', $text . "\r\n\r\n", FILE_APPEND);
}
$message = array("touser" => "@all", "safe" => "0", "agentid" => "3", "msgtype" => "text", "text" => array("content" => "这里是GDS-PE微信号,正在测试中, <a href=\"http://www.gds-services.com\">GDS官网</a>"));
$options = array('token' => 'N6cq3R', 'encodingaeskey' => 'nil3OzTxXoPHx4mvx0GLbyECkPYrfyiB9ca4Iz61ny3', 'appid' => 'wx926454a4965d2b7c', 'appsecret' => 'PsPkG1V74sWm6V2mNN3F2NOHKQT696g1wrmJZhB7WT-8xcLmt-3rez3FfuH3SzCf', 'agentid' => '3', 'debug' => true, 'logcallback' => '_log');
$weObj = new Wechat($options);
$result = $weObj->sendMessage($message, $agentid = '3');
echo var_export($result, true);
示例2: sendMessage
public function sendMessage()
{
\Wechat::sendMessage('您好', 'oUS_vt5i0R1ODvljFbFfKfPr8BuY');
}