function create_menu($data){
$ch = curl_init();//設定選項,包含URL
curl_setopt($ch, CURPT_UR curl_setopt($ch, CURPT_UR https weixin.qq.com/cgi-bin/menu/create?access_token=" .$this->get_token());
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);//使用$ch,CURLOPT_SSL_VERIFYHOST, false);
if(!empty($json_str)){
curl_setopt($ch,CURLOPT_POST, curl_setopt($ch,CURLOPT_POST, curl_setopt($ch,CURLOPT_POST,1 curl_setopt($ch,CURLOPT_POST,1 curl_setopt($ch,CURLOPT_POST,1 curl_setopt($ch,CURLOPT_cST,1 ); CURLOPT_POSTFIELDS,$data);
}
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
# $output = curl_exec($ch);返回最後一次的錯誤號碼
return curl_error($ch); //回傳一個保護目前會話最近一次錯誤的字串
}
1 $output;
}
public function get_menu(){
header('Content-type:text/html file_get_contents("https://api.weixin.qq.com/cgi-bin/menu/get?access_token=".$this->get_token());
return $ }## }
public function del_menu(){
$result=file_get_contents("https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=".$this->ken;
return $result;
}
function create_xin_menu($data){
$ch = cfurl_url() _pse_url api.weixin. qq.com/cgi-bin/menu/addconditional?access_token=".$this -> getToken());
curl_setopt($ch, CUR___ );
curl_setopt($ch, CUR , FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_ curl_setopt($ch, CURLOPT_USERAGENT, 'MozERA/Tot); curl_setopt($ ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_f 銫URLOPT_RETURNTRANSFER, true);
$tmpInfo = curl_exec($ch);
if (curl_errno($ch)) {
回傳curl_error($ch);
}
_$curl_close($c)
) Info);
if(array_key_exists('menuid',$json_arr)){
return $ ;
}
}
}##$wx=new WX();
$wx->create_menu($data);
$arr=array(
'button'=>array(
array (
'type'=>'點擊',
'name'=>'每日新聞',
# array(
'name'=>'綜合',
'sub_button'=>array(
name'=>'音樂',
' type'=>'view',
'url'=>'http://s.music.so.com/s?src=relation_music&q=流行'
1 ) 'name'=>'搞笑',
'type'=>'view',
與 )
),
# ),
array(
),
array(
),
array(
),
array中(
'名稱'=>'php中文網',
'類型'=>'檢視',
'url'=>'http://www.php.cn/'
),
),
json_encode($arr, JSON_UNESCAPED_UNICODE);
$data 在哪裡呢,你沒傳