admin管理员组文章数量:1122846
I am trying to import an excel file on a webpage with a submit button. As far as I can tell, the only way to do so is to use PhpSpreadsheet. How can one incorporate PhpSpreadsheet with $wpdb and wordpress?
I am trying to import an excel file on a webpage with a submit button. As far as I can tell, the only way to do so is to use PhpSpreadsheet. How can one incorporate PhpSpreadsheet with $wpdb and wordpress?
Share Improve this question asked May 18, 2023 at 16:36 John LyonsJohn Lyons 314 bronze badges1 Answer
Reset to default 0I'm assuming you mean this PhpSpreadsheet; if not, please edit your question to clarify.
To incorporate any third-party PHP library into your WordPress site, you'll either need to write a plugin or find one that already does what you need.
The PhpSpreadsheet docs explain how you'd incorporate their library into any PHP application, which includes a WordPress plugin.
composer require phpoffice/phpspreadsheet
composer install
on the command line (in your plugin's root directory) will ensure that the required library|ies are installed. Then, in the plugin's code,
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
...will load the required PHP files and set you up to read and write XLSX files.
Without knowing more about how PhpSpreadsheets works, it's hard to say much more. You'll have to explore their documentation to see how to use their product. Note that third-party product support is off topic here.
If you're not comfortable writing a plugin, and there's not one already in the WP ecosystem that does what you need, you'll have to find someone who can and will do it for you.
本文标签: phpHow to use phpspreadsheet reader with wpdb
版权声明:本文标题:php - How to use phpspreadsheet reader with $wpdb 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736296354a1929772.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论