简体   繁体   中英

PHP simplexlsx class error Call to a member function dimension() while parsing xlsx

During implementing class simplexlsx, while handling multiple sheets xlsx, I am getting an error:

Call to a member function dimension() :

$xlsx = SimpleXLSX::parse('countries_and_population.xlsx')
list( $num_cols, $num_rows ) = $xlsx->dimension();

Any help?

Over searching solution, Found dimension wont work for all xlxs. I replace the code :-

list( $cols, ) = $xlsx->dimension();

to

 $sheet =$xlsx->sheetNames();
    foreach($sheet as $ky=>$rw) 

This works without any issue for all xlsx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM