I'm using matlab excel plugin for convert excel to array. My code is:-
public static function ImportExcel($table="", $path=""){
$data = array();
Excel::load($path, function ($reader) use($data) {
$data = $reader->toArray();
//here data has all excel data in array.
});
return $data; //but here it shows empty array.
}
Check my comments in code. Inside the Excel::load data has array of all data. But its scope is only inside the Excel::load. I need it outside.