Maison >développement back-end >tutoriel php >难道这只能用ajax做么? php出不来了。

难道这只能用ajax做么? php出不来了。

WBOY
WBOYoriginal
2016-06-06 20:47:15888parcourir

<code>//选项卡
    $category['pid'] = '80';
    $this->db->order_by('id','asc');
    $data['h1s'] = $this->M->selects('category', $category, '*');
    $xuan['status'] = '1';
    $this->db->order_by('category_id','asc');
    $data['xuan'] = $this->M->selects('texts', $xuan, '*');

    //echo '<pre class="brush:php;toolbar:false">
'; //print_r($data['xuan']);exit; $i=0; foreach($data['h1s'] as $val){ $i++; //echo $key . '---' . $val['id'] . '---' . $data['xuan'][$i]['category_id'] .'
'; if($val['id'] == $data['xuan'][$i]['category_id']): echo $val['name'].'---'.$val['id'].'---'.$data['xuan'][$i]['category_id'].'---'.$data['xuan'][$i]['header'].'
'; endif; } exit; //foreach($data['h1s'] as $val){ //$i++; //echo $val[0]; //if($val['id'] == $data['xuan'][$i]['category_id']): //echo $val['id'].'---'.$data['xuan'][$i]['category_id'].'
'; //endif; //}exit; //if($data['xuan'][0]['category_id'] == $data['h1s'][0]['id']){ //foreach($data['xuan'] as $val){ //echo $data['xuan'][0]['category_id'] .'--'. $data['h1s'][0]['id'].'
'; //echo 'header:'.$data['xuan'][0]['header'].'id:'.$data['h1s'][0]['id'].'
'; //} //} //print_r($data['h1s']);exit;

用的是ci框架,我想分类的id和文章的id相等后输出,但是内容不正确!

这个问题已被关闭,原因:

回复内容:

<code>//选项卡
    $category['pid'] = '80';
    $this->db->order_by('id','asc');
    $data['h1s'] = $this->M->selects('category', $category, '*');
    $xuan['status'] = '1';
    $this->db->order_by('category_id','asc');
    $data['xuan'] = $this->M->selects('texts', $xuan, '*');

    //echo '<pre class="brush:php;toolbar:false">
'; //print_r($data['xuan']);exit; $i=0; foreach($data['h1s'] as $val){ $i++; //echo $key . '---' . $val['id'] . '---' . $data['xuan'][$i]['category_id'] .'
'; if($val['id'] == $data['xuan'][$i]['category_id']): echo $val['name'].'---'.$val['id'].'---'.$data['xuan'][$i]['category_id'].'---'.$data['xuan'][$i]['header'].'
'; endif; } exit; //foreach($data['h1s'] as $val){ //$i++; //echo $val[0]; //if($val['id'] == $data['xuan'][$i]['category_id']): //echo $val['id'].'---'.$data['xuan'][$i]['category_id'].'
'; //endif; //}exit; //if($data['xuan'][0]['category_id'] == $data['h1s'][0]['id']){ //foreach($data['xuan'] as $val){ //echo $data['xuan'][0]['category_id'] .'--'. $data['h1s'][0]['id'].'
'; //echo 'header:'.$data['xuan'][0]['header'].'id:'.$data['h1s'][0]['id'].'
'; //} //} //print_r($data['h1s']);exit;

用的是ci框架,我想分类的id和文章的id相等后输出,但是内容不正确!

算法问题,与语言无关

what the hell you are writing about?

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn