I have big log file in xml format that I need to store in a single database field as an array.. I get that file by
$request->getContent()
and whatever syntax I write I still get xml format..
This is my code.
public function test(Request $request)
{
file_put_contents('/var/www/html/var/logs/ehi.log', print_r($request->getContent() . '',true), FILE_APPEND);
$array = json_decode(json_encode((array)($request->getContent())),true);
dump($array);die;
}
and the content look like..