I have a file in xlsx format with two spreadsheets and I need to read the data in PHP to create an import script in the database.
I am using the PhpSpreadsheet library to read the files. I can do it when I only have one worksheet in the document, but when there are others it does not work.
Test document.xlsx
Worksheet2
Codetosubmitfile:index.php
<!DOCTYPE html>
<html>
<head>
<title>Importacao</title>
</head>
<body>
<h1>Upload do arquivo</h1>
<form method="POST" action="processa.php" enctype="multipart/form-data">
<label>Arquivo</label>
<input type="file" name="arquivo"><br><br>
<input type="submit" value="enviar">
</form>
</body>
</html>