How to insert data from excel to php

in programer •  4 years ago 

include "../excel_reader2.php";

$data = new Spreadsheet_Excel_Reader($_FILES['fileexcel']['tmp_name'],false);
$nums = $data->rowcount($sheet_index=0);

$yes = 0;
$no = 0;
for ($i=2; $i<=$nums; $i++){

$record['name'] = $data->val($i,2);

$records[]=$record;
if ($nums) $yes++;
else $no++;
}

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!