php趣味成语答题,题库生成.

 php趣味成语答题,题库生成._第1张图片

 

public function question(){

    $idiom = $this->get_rand_idiom();//拿出随机成语

    $arr_rand = $this->make_arr($idiom);//数组

    $idiom_arr[] = $idiom;

    $data =  S('IdiomStory');


    foreach ($data as $key=>$val){
        if (!in_array($val,$idiom_arr)) {
            $arr = $this->make_arr($val);//数组

            if (in_array($arr[0], $arr_rand)) {
                $idiom_arr[] = $val;
                $a = $arr;
                break;
            }
        }
    }

    foreach ($data as $v){
        if (!in_array($v,$idiom_arr)){
            $arr2 = $this->make_arr($v);//数组

            if (in_array($arr[3],$arr2)){
                $idiom_arr[] = $v;
                break;
    

你可能感兴趣的:(微信,php)