im trying to send an array from javascript to Joomla 3.x php file.
var options = ['foo', 'bar'];
$.post('index.php?option=component&view=componentview&Itemid=123&tmpl=component&layout=xlsx', {'xlsx_options': options})
Then, I have a php file which creates data in order to download xlsx file. But I need to filter by this options array and Im not able to retrieve it. I've tried this without success.
$xlsx = $_POST['xlsx_options'];
$xlsx = json_decode($_POST['xlsx_options'], true);
$xlsx = JFactory::getApplication()->input->get('xlsx_options');
Any help? Thanks!