本文实例为大家分享了php微信公众号开发之答题闯关的具体代码,供大家参考,具体内容如下
连闯三关
implode( “,” ,array) 数组变字符串 数组无法保存到数据库中去
explode(“,”,str) 字符串变数组
array_rand($arr,n ) 随机取出数组中 n 个单项
核心代码如下:
public function responseMsg()
{
//get post data, May be due to the different environments
$postStr = $GLOBALS["HTTP_RAW_POST_DATA