I am trying to convert a JSON file to CSV using SimpleExcel: https://github.com/faisalman/simple-excel-php
Following the documentation, I created the following PHP file:
<?
use SimpleExcel\SimpleExcel;
echo "test";
$excel = new SimpleExcel('JSON');
$excel->parser->loadFile('test.json');
echo $excel->parser->getCell(1, 1);
$excel->convertTo('CSV');
$excel->writer->addRow(array('add', 'another', 'row'));
$excel->writer->saveFile('example');
?>
Where test.json is local. For some reason this doesn't work. I was hoping it could create a CSV locally but instead it gives an error:
test Fatal error: Class 'SimpleExcel\SimpleExcel' not found in test.php on line 7
Any tips would be greatly appreciated. Most of their examples focus on converting CSV to XML.
Thanks