<?php 
//怎么写能确立$dut和$test_item的关系? 
$bin = $error[$i];
echo $bin2dut[$bin];
?> 

解决方案 »

  1.   

    回楼上的,我清楚这些变量间的关系。我现在输出不会写。。出来的结果类似于:            Test item(1-160)             Dut(1-256)
                     1
                     2
                     3
                     4                     如果有dut和test_item对应,则显示出来(Dut的序号)  
                    ...
                    160
      

  2.   

    实在不明白你要想做什么了?
    你的流程是怎么样的if(exp)
     statement
    这样的伪码会写不,先用伪码把过程写出来,再来提问.
      

  3.   

    定义变量$bin2dut 获得关系 $bin=>$dut;
    定义变量$error 获得关系 $test_item=>$bin;
    然后求得$bin的值($bin=$error[$test_item];)
    再根据$bin的值通过$bin2dut 获得$dut的值。
    以上部分已实现我现在想知道for($test_item从1-160循环),求得$test_item对应的$dut的值。(输出出来)
      

  4.   

    简单来说就是3个变量,$bin  $test_item  $dut
    我已知$bin和$dut的关系,$bin和$test_item的关系,并求出了$bin的值,$dut的值。现在我要画一个表格,反应出$test_item和$dut的关系。已知$test_item是1个1-160的循环,求对应的$dut输出值。这个输出我不会写,所以请求帮助。
      

  5.   

    循环$test_item
       根据当前$test_item算出$bin
       根据$bin算出$dut
       显示$dut
       想在这里输出?
    结束循环楼主想输出的格式是什么样的?
      

  6.   

    类似5楼的格式 Test item(1-160)            Dut(1-256) 
                    1 
                    2 
                    3 
                    4                    如果有dut和test_item对应,则显示出来(Dut的序号)  
                    ... 
                   160
      

  7.   

    该段代码:<tr class="cells" onmouseover="this.className='cells2'" onmouseout="this.className='cells'"> <td bgColor=#cedcff width=50%> <strong>Test Item(WRIGHT NT) </strong> </td> <td bgColor=#cedcff> <strong>DUT </strong> </td> </tr> 
    <?php 
    for($i=1;$i <161;$i++) 

    ?> 
    <tr class="cells" onmouseover="this.className='cells2'" onmouseout="this.className='cells'"> <td> <?php echo $i ?> </td> <td> 
    <?php 
    //不会写的地方 
    ?> </td> 
    <?php 
      } 
    ?> 
    </tr> 
      

  8.   

    是否有人帮忙解答一下?
    问题描述:
    显示出$test_item和$dut的对应结果循环$test_item(0-160)
    根据当前$test_item算出$bin 
    根据$bin算出$dut 
    显示$dut,输出在表格中。 
    该段代码: <tr class="cells" onmouseover="this.className='cells2'" onmouseout="this.className='cells'"> <td bgColor=#cedcff width=50%> <strong>Test Item(WRIGHT NT) </strong> </td> <td bgColor=#cedcff> <strong>DUT </strong> </td> </tr> 
    <?php 
    for($i=1;$i <161;$i++) 

    ?> 
    <tr class="cells" onmouseover="this.className='cells2'" onmouseout="this.className='cells'"> <td> <?php echo $i ?> </td> <td> 
    <?php 
    //不会写的地方 
    ?> </td> 
    <?php 
      } 
    ?> 
    </tr>