I am getting the following error "xmlParseEntityRef: no name" when trying to parse an ofx file submitted from a file upload form.
I searched over the internet and it looks like the problem is related to the stray ‘&’ (ampersand character) somewhere in the file. How can I come over this? They suggest to remove or encode the ampersand, but the file is being uploaded from an upload form.
$file_path = $_FILES["fileUpload"]["tmp_name"];
$ofxParser = new \OfxParser\Parser();
$ofx = $ofxParser->loadFromFile($file_path);
$bankAccount = reset($ofx->bankAccounts);
// Get the statement transactions for the account
$transactions = $bankAccount->statement->transactions;
var_dump($startDate, $endDate, $transactions);
I am getting the following error "xmlParseEntityRef: no name" when trying to parse an ofx file submitted from a file upload form.
I searched over the internet and it looks like the problem is related to the stray ‘&’ (ampersand character) somewhere in the file. How can I come over this? They suggest to remove or encode the ampersand, but the file is being uploaded from an upload form.