Rumah > Soal Jawab > teks badan
fungsi create_menu($data){
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);//Gunakan https
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
jika (!kosong( $json_str)){
curl_setopt($ch, CURLOPT_POST,1);
atas atas curl_setopt(($ch ,CUR) LOPT_RETURNTRANSFER,true);
$output = curl_exec($ch) ;//Laksanakan dan dapatkan kandungan dokumen HTML
; L Curl_Close ($ ch); }
Public function get_menu () {
Header ('Content-Type: Text/HTML; Charset = UTF -8 '); -$ result=file_get_contents("https://api.weixin.qq.com/cgi-bin /menu/get?access_token=".$this->get_token());
return $result;
}
public function del_menu (){
$result=file_in.qapi. com/cgi-bin/menu/delete?access_token=".$this->getToken());
menggunakan menggunakan }
fungsi create_xin_menu($data){
$ch = curl_init();
curl_setopt($ch , CURLOPT_URL, "https://api.weixin.qq.com/cgi-bin/menu/addconditional?access_token=" $this -> getToken());
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST") ;
curl_setopt ($ ch, curlopt_ssl_verifypeer, false);
curl_setopt ($ ch, curlopt_ ssl_verifyHost, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$tmpInfo = curl_exec($ch);
if (curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
$json_arr mp = (Info if(array_key_exists('menuid',$ WWW
$wx->create_menu($data);
$arr=array(
'button'=>array(
array(
'type'=>'klik',
nama 'kunci'=>' V1001_XIN_WEN'
),
tatasusunan(
'name'=>'综合',
'sub_t ;ar = tatasusunan(
'name'=>'音乐',
'type'=>' view',
'url'=>'http://s.music.so.com/s?src=relation_music&q=%E6%B5%81%E8%A1%8C'
),
' nama '= & gt;' 搞笑 ',
' type '= & gt;' view ',
' url '= & gt;' https: //v.qq.com/x/channel/fun'
)
),
),
tatasusunan(
'nama'=>'学习',
'sub_button'=>array( 'name'=>'php中文网',
'type'=>' pandangan',
'url'=>'http://www.php.cn/'
),
),
)
),
);
.