api.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Created by ChenTAO.
  4. * User: Administrator
  5. * Date: 15-10-8
  6. * Time: 下午1:27
  7. */
  8. include_once "config.php";
  9. include_once "WeiXin.php";
  10. $op = isset($_GET['op'])?$_GET['op']:'';
  11. $weixin = new WeiXin($appId,$appSecret,$token);
  12. //if(empty($op))$weixin->valid();
  13. //$weixin->init()->responseMsg();
  14. //$result = $weixin->init()->changUserGroup(array('o8tdvt6CdCdo1ZOY_SzYUSO8_o7o'),0);
  15. //$result = $weixin->init()->getUserInfo('o8tdvt6CdCdo1ZOY_SzYUSO8_o7o');
  16. /*$buttons = array(
  17. array(
  18. "type"=>"location_select",
  19. "name"=>"当前位置",
  20. "key"=>"mylocation"
  21. ),
  22. array(
  23. "type"=>"view",
  24. "name"=>"百度一下",
  25. "url"=>"http://www.baidu.com"
  26. ),
  27. array(
  28. 'name'=>'弹出二级',
  29. 'sub_button'=>array(
  30. array(
  31. "type"=>"pic_weixin",
  32. "name"=>"传图",
  33. "key"=>"upload"
  34. ),
  35. ),
  36. )
  37. );
  38. $weixin->init()->createMenu($buttons);
  39. */
  40. $result = $weixin->init()->receiveMsg();
  41. file_put_contents('test.txt',var_export($result,true));