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()
怎么写? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询