如何访问 PHP 中的 word 文档的文件名?
How to access filename of word document in PHP?
我在 PHP 中开发了一些代码来从 Word 文档中读取标签信息。我想知道如何从 word 文档中读取文件名并将其存储在数据库中 table?好吧,我知道如何附加到数据库 table 但不确定如何检索文件名..
我的代码:
echo "Keywords : " . $docxmeta->getKeywords() . "<br>";
$Keywords = $docxmeta->getKeywords();
?>
我试过$Filename = $docxmeta ->getFileName();
,但没有用,我敢肯定,如果有人可以帮助我,一定有其他方法吗?
您可以扫描目录,它将return 一组文件名。这对你有帮助吗?
<?php
$dir = '/tmp';
$files1 = scandir($dir);
print_r($files1);
?>
我在 PHP 中开发了一些代码来从 Word 文档中读取标签信息。我想知道如何从 word 文档中读取文件名并将其存储在数据库中 table?好吧,我知道如何附加到数据库 table 但不确定如何检索文件名..
我的代码:
echo "Keywords : " . $docxmeta->getKeywords() . "<br>";
$Keywords = $docxmeta->getKeywords();
?>
我试过$Filename = $docxmeta ->getFileName();
,但没有用,我敢肯定,如果有人可以帮助我,一定有其他方法吗?
您可以扫描目录,它将return 一组文件名。这对你有帮助吗?
<?php
$dir = '/tmp';
$files1 = scandir($dir);
print_r($files1);
?>