Skip to content

微信公众平台私有接口, 发送信息, 得到用户信息, 解析用户fakeId

Notifications You must be signed in to change notification settings

wonTonx/WeiXin-Private-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeiXin-Private-API

微信公众平台私有接口, 发送信息, 发送图片, 得到用户信息, 解析用户fakeId

本接口参考weChat, 在此基础上作了修改和完善.

使用:

  1. 先在conifg.php中配置公共账号信息:
	$G_CONFIG["weiXin"] = array(
		'account' => '公共平台账号',
		'password' => '密码',
		'cookiePath' => $G_ROOT. '/cache/cookie', // cookie缓存文件路径
		'webTokenPath' => $G_ROOT. '/cache/webToken', // webToken缓存文件路径
	);
  1. test.php:
	require "config.php";
	require "include/WeiXin.php";

	$weiXin = new WeiXin($G_CONFIG['weiXin']);
	
	$testFakeId = "1477341522";
	$testFakeId2 = "2158620204";
	
	// 发送消息
	print_r($weiXin->send($testFakeId, "test"));
	
	// 发送图片, 图片必须要先在公共平台中上传, 得到图片Id
	print_r($weiXin->sendImage($testFakeId, "10000001"));
	
	// 批量发送
	print_r($weiXin->batSend(array($testFakeId, $testFakeId2), "test batSend"));
	
	// 得到用户信息
	print_r($weiXin->getUserInfo($testFakeId));
	
	// 得到最新消息
	print_r($weiXin->getLatestMsgs());

About

微信公众平台私有接口, 发送信息, 得到用户信息, 解析用户fakeId

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published