Example #1
0
 public function GetMyinfo()
 {
     $this->getHeader = 0;
     $html = $this->vget("https://mp.weixin.qq.com/cgi-bin/settingpage?t=setting/index&action=index&token=" . $this->token . "&lang=zh_CN");
     $html = StringUtitly::SubString($html, 'class="account_setting_area"', '</ul>');
     $rz = preg_match_all('/<li class="account_setting_item">.*?<h4>(.*?)<\\/h4>.*?<div class="meta_content">(.*?)<\\/div>.*?<\\/li>/is', $html, $matches);
     if ($rz === false) {
         return false;
     }
     $attrs = [];
     foreach ($matches[1] as $index => $item) {
         if ($item == '头像') {
             $img = $matches[2][$index];
             preg_match('/src="(.*?)"/is', $img, $ma);
             $attrs[$item] = 'https://mp.weixin.qq.com' . $ma[1];
         } else {
             $attrs[$item] = StringUtitly::RemoveHtmlTag($matches[2][$index]);
         }
     }
     return $attrs;
 }