关于php的switch语句的问题!
switch($RX_TYPE){case"text":$result=$this->receiveText($postObj);break;case"voice":$r...
switch ($RX_TYPE)
{
case "text":
$result = $this->receiveText($postObj);
break;
case "voice":
$result = $this->receiveText1($postObj);
break;
case "event":
$resultStr = $this->receiveEvent($postObj);
break;
default:
$result = "unknown msg type: ".$RX_TYPE;
break;
}
比如这个 如果 我接收到的$RX_TYPE是voice 那就想运行两个方法
receiveText1()和receiveText2()
就是 关键词voice的时候 先运行receiveText1() 再运行 receiveText2()
怎么写?(用来回复微信平台的回复,用户每次发信息就给他回复两次) 展开
{
case "text":
$result = $this->receiveText($postObj);
break;
case "voice":
$result = $this->receiveText1($postObj);
break;
case "event":
$resultStr = $this->receiveEvent($postObj);
break;
default:
$result = "unknown msg type: ".$RX_TYPE;
break;
}
比如这个 如果 我接收到的$RX_TYPE是voice 那就想运行两个方法
receiveText1()和receiveText2()
就是 关键词voice的时候 先运行receiveText1() 再运行 receiveText2()
怎么写?(用来回复微信平台的回复,用户每次发信息就给他回复两次) 展开
展开全部
switch ($RX_TYPE)
{
case "text":
$result = $this->receiveText($postObj);
break;
case "voice":
$result1 = $this->receiveText1($postObj);
$result2 = $this->receiveText2($postObj);//你为什么不给他加上一个调用的方法 运行完1运行2 这样不可以吗 我不懂。。。
break;
case "event":
$resultStr = $this->receiveEvent($postObj);
break;
default:
$result = "unknown msg type: ".$RX_TYPE;
break;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询