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()
2 回答
函数式编程
TA贡献1807条经验 获得超9个赞
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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; } |
- 2 回答
- 0 关注
- 392 浏览
添加回答
举报
0/150
提交
取消