腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
3
回答
带有
natsort
的
PHP
DirectoryIterator
php
、
html
、
natsort
我正在检索一个列表,如果从一个目录
的
照片文件,并回声到一个网页,以便该页面可以自动创建任何相册。 下面的代码运行良好,但结果是照片
的
顺序不是很自然,这是我更喜欢
的
: <?images/photos/album/medium';$files = new
DirectoryIterator
($directory); foreach ($file
浏览 31
提问于2021-10-23
得票数 1
回答已采纳
3
回答
获取编号最高
的
文件并创建下一个文件
php
我有一个文件夹,其中包含名为standard_xx.jpg
的
文件(xx是一个数字)我已经创建了一种方法,只需分解文件名即可完成此操作,但它并不是很优雅echo $newfile; 有没有更有效或更优雅
的
方式来做这件事呢?
浏览 0
提问于2013-01-09
得票数 1
回答已采纳
7
回答
如何使用
PHP
按字母顺序列出目录中
的
所有文件?
php
、
sorting
、
directory
、
readdir
、
opendir
我使用以下
PHP
代码列出当前目录下
的
所有文件和文件夹: $dirname = ".= "index.
php
")) echo("<a href='$file'>$file</a> <br />");问题是列表不是按字母顺序排列
的
(也许它是按创建日期排序
的
浏览 4
提问于2010-10-20
得票数 21
回答已采纳
4
回答
PHP
递归函数:获取目录及其子目录中
的
所有文件和目录。
php
、
arrays
、
function
、
recursion
、
file-structure
我已经编写了一个
php
function,通过它,我需要一个包含特定directory中
的
所有files和directories
的
数组。1)下面是我
的
目录结构-||--file3.
php</
浏览 3
提问于2014-04-21
得票数 0
回答已采纳
1
回答
使用
PHP
文件夹创建HTML菜单
php
、
html
我正在编写一个库,并希望创建一个
带有
项目文件夹
的
通用HTML菜单。我有这样
的
结构:functionfillArrayWithFileNo
浏览 0
提问于2014-04-29
得票数 0
2
回答
PHP
中不一致
的
DirectoryIterator
+FilterIterator行为?
php
、
spl
我编写了一个使用来自标准
PHP
库(SPL)
的
FilterIterator类
的
脚本,在
PHP
5.x版本中得到不同
的
行为:(这里是accept()函数:{$current = $this->current();}
DirectoryIterator
[glob:
D
浏览 3
提问于2010-01-19
得票数 1
回答已采纳
2
回答
php
directoryIterator
的
问题-错误
的
路径?
php
、
path
、
iterator
、
directory
images/headers/';//ouput: myblog.com/wp-content/themes/mytheme/images/headers 2011年4月26日
PHP
致命错误:
带有
message '
DirectoryIterator
::__construct()
di
浏览 1
提问于2011-04-26
得票数 0
回答已采纳
1
回答
带有
DirectoryIterator
的
简单
PHP
库
php
、
iterator
、
directory
、
gallery
我正在尝试从一个目录构建一个简单
的
图库。到目前为止:function listYears(){foreach (new
DirectoryIterator
($basefolder; echo '<a href="index.
php
?$fileInfo->getFilename() .'">
浏览 0
提问于2014-09-19
得票数 0
1
回答
带有
前导字符
PHP
的
natsort
故障
php
、
arrays
、
natsort
我有几百个xhtml文件,我将它们
的
名称推入一个数组中。命名约定为p0x.xhtml,其中x为1-400。我试图对数组执行
natsort
操作,但是前导
的
p似乎与排序冲突。作为最后
的
手段,我可以重命名文件,但如果可能的话,我想避免这种情况。如果有人知道解决办法,我将不胜感激。$arr = [ 'p08.xhtml',];
natsort
($
浏览 3
提问于2013-07-13
得票数 0
回答已采纳
1
回答
为什么纳提类在将数组合并到for循环中时会在数组上失败?
php
、
arrays
、
sorting
在我
的
站点
的
一个页面上,我对9个不同
的
数组进行了9次排序,一切都按预期进行:
natsort
($Array2);
natsort
($Array4);
natsort
($Array6);
natsort
($Array8);
natsort
($
浏览 5
提问于2014-04-11
得票数 0
回答已采纳
1
回答
PHP
中具有适当小数支持
的
自然数组排序
php
、
arrays
、
sorting
我想要按自然顺序对
带有
数字
的
数组进行排序,这样具有较大值
的
数字会紧跟在较小
的
数字之后,如下所示:
php
> $numbers = array('10 Apple', '2 Grapes', '3 Apples', '3.2 Apples', '3.1 Apples', '3.3 Apples', '3.10 Apples', '3.11 Apples
浏览 25
提问于2021-06-23
得票数 1
回答已采纳
3
回答
php
DirectoryIterator
按日期对文件进行排序
php
、
file
、
sorting
我使用
php
的
DirectoryIterator
类来列出目录中
的
文件。然而,我想不出一种简单
的
方法来按日期对文件进行排序。这是如何使用
DirectoryIterator
实现
的
$dir = new
DirectoryIterator
('.'); echo $fileinfo->getFilename>
浏览 2
提问于2011-10-04
得票数 18
回答已采纳
1
回答
找不到'
DirectoryIterator
‘类
php
、
symfony
当我尝试使用某些类时,例如
DirectoryIterator
或DOMDocument,我收到以下异常:如果试图在simfon
浏览 1
提问于2013-01-20
得票数 4
回答已采纳
7
回答
PHP
数组
的
反向自然排序,不保留键
php
、
arrays
、
sorting
srting[2] => 3-string[4] => 1-string 我已经接近了usort($array,'strnatcmp');但它
的
顺序并不相反
浏览 0
提问于2012-03-24
得票数 6
回答已采纳
3
回答
DirectoryIterator
::getExtension()版本
php
我正在从CLI运行一个
PHP
脚本,它使用
PHP
中
的
DirectoryIterator
::getExtension()方法。我运行
的
PHP
版本是5.3.5,但我一直收到错误提示Fatal error: Call to undefined method
DirectoryIterator
::getExtension() 该脚本在运行
PHP
5.3.6
的
本地开发机器上运行良好,没有任何错误。但是,
PHP
中
的</em
浏览 0
提问于2011-12-15
得票数 7
回答已采纳
1
回答
PHP
DirectoryIterator
类在VirtualBox共享文件夹中不返回任何条目
php
、
virtualbox
我发现,当我尝试使用
PHP
中
的
DirectoryIterator
类(https://www.
php
.net/manual/en/class.
directoryiterator
.
php
)遍历一个目录时,它对于VM中
的
标准文件夹工作得很好。但是,如果我试图迭代共享文件夹
的
目录条目(从主机映射到来宾),那么.和..就是我得到
的
唯一条目。 我可以使用opendir和readdir函数在
浏览 39
提问于2020-11-20
得票数 0
2
回答
如何有效地使用
DirectoryIterator
?
php
、
performance
、
spl
我需要从包含大量文件
的
目录中筛选出一些文件。在我
的
脚本中,这个函数被调用了很多次。getFilteredFiles($criteria) { if ($files == '') { ... }
浏览 2
提问于2012-05-17
得票数 3
回答已采纳
1
回答
DirectoryIterator
在网络附加存储中失败
php
、
filesystems
这是最简单
的
迭代器:<html> <?
php
{ if (!行
的
UnexpectedValueException中,系统找不到指定
的
路径(代码:3),其中包含消息'
DirectoryIterator
::__construct(z:
浏览 2
提问于2015-03-16
得票数 0
回答已采纳
1
回答
选择要编辑
的
文件
php
、
text-files
、
fopen
、
fwrite
、
readdir
我有一个用于编辑.txt文件
的
应用程序。应用程序由三部分组成。 $relPath = 'file_to_edit.txt';但是,我想要
浏览 1
提问于2013-05-21
得票数 2
回答已采纳
2
回答
正确使用
Natsort
php
我制作了这个小脚本来从目录中提取照片
的
名字。$dirname = "newspaper_articles/nameofperson/1951-1977/";但是,我
的
代码是这样呈现
的
;11 articletitle.jpg2个article
浏览 1
提问于2013-11-27
得票数 0
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
对象存储
ICP备案
云点播
实时音视频
活动推荐
运营活动
广告
关闭
领券