Is there a way to fetch data from xmlhttprequest Object as an array (not using json & jquery) in php?
I have encountered a text saying that in order to handle ajax requests in php it will be first checked whether the input data is an array or not. here's the code regarding the text:
<?php
$data = $_REQUEST['fld'];
if ( is_array($data) )
echo file_put_contents('db.csv', implode(",", $data) . "\n", FILE_APPEND) ? 1 : 2;
else
echo 3;//Error
?>