Welcome Guest, Not a member yet? Register   Sign In
array values shows null
#1

this is my coding


      $objWorksheet=$objPHPExcel->setActiveSheetIndex(0); 
      for($i=12;$i<=20;$i++)
      {       
      $regno= $objWorksheet->getCellByColumnAndRow(2,$i)->getValue();
      $assmark= $objWorksheet->getCellByColumnAndRow(5,$i)->getValue();


    $data=array( 'regno'=>$regno,$ass=>$assmark);
    echo '<pre>';
    print_r($data);
    echo '</pre>';
my actual output will be 8. but i got more values with null. what is wrong with this. i attached my output screen also

Attached Files Thumbnail(s)
   
Reply
#2

Your $i variable should not be 12.

It should probably be 0 or 1
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(06-28-2018, 04:28 AM)InsiteFX Wrote: Your $i variable should not be 12.

It should probably be 0 or 1

I got it. Thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB