Home > Backend Development > PHP Tutorial > 难道这只能用ajax做么? php出不来了。

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:47:15
Original
919 people have browsed it

<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">
Copy after login
Copy after login
'; //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">
Copy after login
Copy after login
'; //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?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template